我在使用命令參數類型爲sqldbtype.datatime
未能參數值從字符串轉換爲datetime
這裏得到一個錯誤是我使用
cmd.Parameters.Add("@Posted_date", SqlDbType.DateTime).Value = Convert.ToDateTime(dt.Rows[i]["messagePostedDate"]);
錯誤代碼「未能轉換參數值從一個字符串到DateTime「和dt.Rows [i] [」messagePostedDate「]的值是」2008-10-01 00:00:00.000「 -
有誰知道可能是什麼問題?
當您收到錯誤時,Waht是dt.Rows [i] [「messagePostedDate」]的值嗎? – rrrr
你得到哪個錯誤? –
我向你的問題添加了一個實際問題,如果你想得到一個答案 – Patrick