Vipin Saxena

Vipin Saxena

  • NA
  • 32
  • 1.3k

facing error in the following code plz help

Aug 3 2015 6:40 AM
Qestion: What is the error in following  code ??  
OleDbConnection con = new OleDbConnection(constring);
con.Open();
string str1="Update facultyload set FacultyName=@p1,Batch=@p2,Time=@p3,StartDate=@p4,Schedule=@p5 Where fid=@p6";
OleDbCommand updatecmd = new OleDbCommand(str1, con);
updatecmd.Parameters.AddWithValue("@p6", textBox4.Text);
updatecmd.Parameters.AddWithValue("@p1", textBox1.Text);
updatecmd.Parameters.AddWithValue("@p2", comboBox1.Text);
updatecmd.Parameters.AddWithValue("@p3", textBox2.Text);
updatecmd.Parameters.AddWithValue("@p4", dateTimePicker1.Text);
updatecmd.Parameters.AddWithValue("@p5", comboBox2.Text);
updatecmd.ExecuteNonQuery();
MessageBox.Show("Record Updated");
con.Close();
 

Answers (6)