Show a Message box in WinForm(C#), whenever Data is inserted in DataBase from BackEnd or Front-End
Thanks in Advance
Anurag
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rakesh KaushikPosted Mar 4, 2013, 5:01 AM
MessageBox.Show("Record save successfully !");
Satyapriya NayakPosted Mar 4, 2013, 4:25 AM
con.Open();
str = "insert into student(id,name) values (@id,@name)";
com = new OleDbCommand(str, con);
com.Parameters.AddWithValue("@sid", textBox1.Text);
com.Parameters.AddWithValue("@sname", textBox2.Text);
int affectedRows = com.ExecuteNonQuery();
con.Close();
MessageBox.Show(affectedRows + ":::Records Successfuly Inserted");
Anurag SrivastavaPosted Mar 4, 2013, 4:15 AM
Satyapriya NayakPosted Mar 4, 2013, 4:05 AM
OleDbConnection con = new OleDbConnection(ConnectionString);
con.Open();
str = "insert into student(id,name) values (@id,@name)";
com = new OleDbCommand(str, con);
com.Parameters.AddWithValue("@sid", textBox1.Text);
com.Parameters.AddWithValue("@sname", textBox2.Text);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show("Records Successfuly Inserted");