suhel jamadar

suhel jamadar

  • 1.9k
  • 104
  • 1.8k

ExecuteNon query error at date time

Oct 14 2020 2:12 AM
SqlCommand cmd = new SqlCommand("INSERT INTO Monitor VALUES(@LCDSrNo, @ProductName, @LCDProductNo, @Date)", con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@LCDSrNo", textBox2.Text);
cmd.Parameters.AddWithValue("@ProductName", textBox3.Text);
cmd.Parameters.AddWithValue("@LCDProductNo", textBox4.Text);
cmd.Parameters.AddWithValue("@Date", dateTimePicker1);
con.Open();
cmd.ExecuteNonQuery();
con.Close();

Brought to you by:

Answers (11)