You put your parameters in an
OleDbDataAdapter
but you are nowhere using
da
to pass the parameters (also, you shouldn't use SelectCommand anyway, but InsertCommand); it looks like you don't actually need the OleDbDataAdapter so you can drop
da
and just set the parameters using
cmd.Parameters
:
string query1 = "INSERT INTO Spldetails([Date],[EmpId],[EmpName],[Designation],[Records],[Splwrkhrs],[Team],[Splwrk],[Splwrkdetails],[Allottedby]) VALUES(@d1,@v1,@v2,@dg,@rd,@shr,@tm,@sw,@sd,@ab)";
con1.Open();
OleDbCommand cmd = new OleDbCommand(query1, con1);
cmd.Parameters.Add("@v1", OleDbType.Variant, 30).Value = this.textBox1.Text;
cmd.ExecuteNonQuery();