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();

Upendra Pratap ShahiPosted Aug 20, 2015, 3:38 AM
Vipin SaxenaPosted Aug 20, 2015, 2:09 AM
Upendra Pratap ShahiPosted Aug 4, 2015, 1:00 AM
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.ToString());
updatecmd.Parameters.AddWithValue("@p3", textBox2.Text);
updatecmd.Parameters.AddWithValue("@p4", dateTimePicker1.Text);
updatecmd.Parameters.AddWithValue("@p5", comboBox2.Text.ToString());
updatecmd.ExecuteNonQuery();
MessageBox.Show("Record Updated");
con.Close();
Manas MohapatraPosted Aug 4, 2015, 12:49 AM
Vipin SaxenaPosted Aug 4, 2015, 12:35 AM
Manas MohapatraPosted Aug 3, 2015, 6:59 AM