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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Mar 3, 2013, 11:05 PM EST
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");
Anurag Srivastava38 reputationPosted Mar 3, 2013, 11:15 PM EST
Satyapriya NayakRank #47 · 31.5K reputationPosted Mar 3, 2013, 11:25 PM EST
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");
Rakesh Kaushik29 reputationPosted Mar 4, 2013, 12:01 AM EST
MessageBox.Show("Record save successfully !");