Alert message before before performing button_clicking event in C#.NET
I am creating an data driven application in C#.NET. In this application when user click on load button, data from csv file will be loaded in data grid view.
Further, there is save button to insert data from data grid view into database. I am trying to insert alert message at time of inserting data into database.
eg) user click on save button then it should show him message like do yow want to save data or not and if it click on ok data should be inserted into database and if he press cancel it should stop.
I am using this code, I don't whether it is proper or not before save button clicking event.
MessageBox.Show("Do You Want To Save Data!", "Alert", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
Can a开发者_C百科ny provide me with proper solution.
Thanks, Rushabh Shah.
if (MessageBox.Show("Do You Want To Save Data!", "Alert", MessageBoxButtons.OKCancel,
MessageBoxIcon.Error) == DialogResult.OK))
SaveDataHere();
精彩评论