I really need help from you guys... my Insert statement doesn't work in C# but the Update statement was just fine.
Possible to guide me on the delete statement as well?
Here is my code:
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\Inetpub\\wwwroot\\H1N1\\TTH H1N1\\TTH H1N1\\bin\\Debug\\H1N1.mdb";
OleDbConnection conn = new OleDbConnection(ConnectionString);
OleDbCommand cmd = new OleDbCommand("INSERT INTO H1N1_info (Visitor ID, Visitor Name, Visitor NRIC, Gender, Temperature, PatientName, Patient Wald, Patient Bed, Relationship, Time In) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",conn);
cmd.Parameters.Add("@Visitor Name", OleDbType.VarChar).Value = txtname.Text;
cmd.Parameters.Add("@Visitor NRIC", OleDbType.VarChar).Value = txtic.Text;
cmd.Parameters.Add("@Gender", OleDbType.VarChar).Value = txtgender.Text;
cmd.Parameters.Add("@Temperature", OleDbType.VarChar).Value = txttemp.Text;
cmd.Parameters.Add("@Patient Name", OleDbType.VarChar).Value = txtpname.Text;
cmd.Parameters.Add("@Patient Wald", OleDbType.VarChar).Value = txtwallno.Text;
cmd.Parameters.Add("@Patient Bed", OleDbType.VarChar).Value = txtbedno.Text;
cmd.Parameters.Add("@Relationship", OleDbType.VarChar).Value = txtrelationship.Text;
cmd.Parameters.Add("@Time In", OleDbType.VarChar).Value = txttimein.Text;
cmd.Parameters.Add("@Visitor ID", OleDbType.VarChar).Value = txtid.Text;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
ClearForm(this);
MessageBox.Show("Record Added!");