如何改?该字符串未被识别为有效的日期时间。有一个从索引 0 处开始的未知字。
private void Button5_Click(object sender, System.EventArgs e)
{
string strconn= ConfigurationSettings.AppSettings["vote"];
//连接本地计算机的WMS数据库
SqlConnection cn1= new SqlConnection (strconn);
cn1.Open ();
SqlCommand cm1=new SqlCommand ("TimeAdd",cn1);
cm1.CommandType =CommandType.StoredProcedure ;
cm1.Parameters .Add ("@mintime",SqlDbType.DateTime );
cm1.Parameters .Add ("@maxtime",SqlDbType.DateTime );
cm1.Parameters ["@mintime"].Value =mintime.Text .ToString ();
cm1.Parameters ["@maxtime"].Value =maxtime.Text. .ToString ();
cm1.ExecuteNonQuery ();
cn1.Close ();
}