0
" how can i remove this exception  ?.....Data type mismatch in criteria expression.";
"here is attechment of code.";
"

            con.Open();
            OleDbCommand com = new OleDbCommand("INSERT INTO grn(GRNID,PO,REMARKS,VENDERSID,STATUS,DELEVERYDATE,GRNAMMOUNT)Values(@GRNID,@PO,@REMARKS,@VENDERSID,@STATUS,@DELEVERYDATE,@GRNAMMOUNT)", con);
            com.Parameters.AddWithValue("@GRNID", textBox1.Text);
            com.Parameters.AddWithValue("@PO", comboBox2.Text);
            com.Parameters.AddWithValue("@REMARKS", textBox3.Text);
            com.Parameters.AddWithValue("@VENDERSID", textBox8.Text);
            com.Parameters.AddWithValue("@STATUS", textBox6.Text);
            com.Parameters.AddWithValue("@DELEVERYDATE", dateTimePicker2.Text);
            com.Parameters.AddWithValue("@GRNAMMOUNT", textBox7.Text);
            com.ExecuteNonQuery();
            MessageBox.Show("Your Record is inserted successfully...");
            con.Close(); ";
Attachments exception_err1.JPG 145.27 KB
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by finito
0
com.Parameters.AddWithValue("@DELEVERYDATE", dateTimePicker2.Value.ToString("yyyyMMdd hh:mm:ss:fff"));
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.