I have been tinkering with this for over 2 hours now and i still cannot figure out what is wrong with it.
private void b_Add_Click(object sender, EventArgs e)
{
try
{
string Query = "INSERT INTO tbl_Employee (s_EmpNumber, s_EmpLastName, s_EmpMiddleName, s_EmpAddress, s_EmpZip, s_EmpPhone, i_EmpPayLevel, i_EmpPayGrade) (s_String, i_Integer)"
+ "VALUES(" + "\"" + tb_EmpNumber.Text + "\"" + "," +
tb_EmpFirstName.Text + "\"" + ","
+ "\"" + tb_EmpLastName.Text + "\"" + ","
+ "\"" + tb_EmpMiddleName.Text + "\"" + ","
+ "\"" + tb_EmpAddress.Text + "\"" + ","
+ "\"" + tb_EmpZip.Text + "\"" + ","
+ "\"" + tb_EmpPhone.Text + "\"" + ","
+ Convert.ToInt32(tb_EmpPayLevel.Text) + ","
+ Convert.ToInt32(tb_EmpPayGrade.Text) + ")";
OleDbConnection Connection = new OleDbConnection(gs_ConnString);
OleDbCommand Command = new OleDbCommand(Query, Connection);
Connection.Open();
OleDbDataReader Reader;
Reader = Command.ExecuteReader();
Reader.Close();
Connection.Close();
}//end try
catch (Exception YorkProducts)
{
MessageBox.Show("Message: " + YorkProducts.Message,
"tbl_Employee ADD Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}//end catch
}
please help,
thank you