在插入日期时间时从字符串转换日期和/或时间时转换失败
button_Print.Visible = true;
//comboBox_emp.Visible = false;
string connectionString = "Data Source=.\\sqlexpress;Initial Catalog=db-ub;Integrated Security=True";
string sql = ("SELECT * FROM Visitors WHERE Day_In='" + Convert.ToDateTime(dateTimePicker1.Value) + "'");
SqlConnection connection = new SqlConnection(connectionString);
connection.Open();
sCmd = new SqlCommand(sql, connection);
sAdpt = new SqlDataAdapter(sCmd);
sBldr = new SqlCommandBuilder(sAdpt);
sDs = new DataSet();
sAdpt.Fill(sDs, "Visitors");
sTable = sDs.Tables["Visitors"];
connection.Close();
dataGridView_UB.DataSource = sDs.Tables["Visitors"];
dataGridView_UB.ReadOnly = true;
dataGridView_UB.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
}