Hi guys I need to show message "record successfully updated" when i updated database only not every time
i retrieve data or show data
private void Driver_Load(object sender, EventArgs e)
{
string constr = "Data Source=" + value1 + ";Initial Catalog=" + value2 + ";User ID=" + value3 + ";Password=" + value4 + "";
con = new SqlConnection(constr);
string comdstr = "select * from Driver";
da = new SqlDataAdapter(comdstr, constr);
ds = new DataSet();
da.Fill(ds, "Driver");
dt = new DataTable();
dt = ds.Tables["Driver"];
totalrecord = dt.Rows.Count;
if (ds != null)
{
dt = ds.Tables[0];
currrecord = 0;
}
fillcontrol();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
FleetManagment.Fleet fleet1 = new FleetManagment.Fleet();
int a = fleet1.UpdateDriver("Data Source=" + value1 + ";Initial Catalog=" + value2 + ";User ID=" + value3 + ";Password=" + value4 + "", Convert.ToInt32(textBox1.Text), textBox2.Text, textBox3.Text, textBox4.Text);
if (a>0)
{
message box.show("record successfully updated");
}
My code above working without any problem
But my problem why message box.show("record successfully updated")
display in every time i retrieve data or showing data
the screen shoot problem found in this link below :
as rar file
Thanks
i retrieve data or show data
private void Driver_Load(object sender, EventArgs e)
{
string constr = "Data Source=" + value1 + ";Initial Catalog=" + value2 + ";User ID=" + value3 + ";Password=" + value4 + "";
con = new SqlConnection(constr);
string comdstr = "select * from Driver";
da = new SqlDataAdapter(comdstr, constr);
ds = new DataSet();
da.Fill(ds, "Driver");
dt = new DataTable();
dt = ds.Tables["Driver"];
totalrecord = dt.Rows.Count;
if (ds != null)
{
dt = ds.Tables[0];
currrecord = 0;
}
fillcontrol();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
FleetManagment.Fleet fleet1 = new FleetManagment.Fleet();
int a = fleet1.UpdateDriver("Data Source=" + value1 + ";Initial Catalog=" + value2 + ";User ID=" + value3 + ";Password=" + value4 + "", Convert.ToInt32(textBox1.Text), textBox2.Text, textBox3.Text, textBox4.Text);
if (a>0)
{
message box.show("record successfully updated");
}
My code above working without any problem
But my problem why message box.show("record successfully updated")
display in every time i retrieve data or showing data
the screen shoot problem found in this link below :
as rar file
Thanks