取当前日期插入datagrid中碰到的问题,高手相助
代码如下:
mycommand.Parameters .Add (new SqlParameter ("@cidate", SqlDbType.DateTime,8 ));
mycommand.Parameters ["@cidate"].Value =DateTime.Today;
有错吗?
系统报错如下:
输入字符串的格式不正确。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.FormatException: 输入字符串的格式不正确。
源错误:
行 252: mycommand.Parameters ["@cideduct"].Value =TextBox9.Text.Trim ();
行 253: mycommand.Connection .Open ();
行 254: mycommand.ExecuteNonQuery();
行 255: message.Style ["color"]="blue";
行 256: message.InnerHtml ="数据添加成功";