if(Addflag==1) string confirmvalue = Request.Form["confirm_value"];//for first msg("are you want to save"); if (confirmvalue== "Yes") { con.Close(); con.Open(); sqlcmd2 = new SqlCommand("INSERT INTO city_name(C_name) VALUES('" + txtbox_city.Text + "')", con); sqlcmd2.ExecuteNonQuery(); txtbox_city.Text = string.Empty; } else if (confirmvalue == "No") { msg("cancelled"); } } 3.So now i want like that same confirmation value for second msg box like: if(Addflag==1) string confirmvalue = Request.Form["confirm_value"];//for first msg("are you want to save"); if (confirmvalue== "Yes") { con.Close(); con.Open(); sqlcmd2 = new SqlCommand("INSERT INTO city_name(C_name) VALUES('" + txtbox_city.Text + "')", con); sqlcmd2.ExecuteNonQuery(); txtbox_city.Text = string.Empty; } else if (confirmvalue == "No") { msg("cancelled"); } } if (Editflag == 1) { string edit_qry = "select * from ledger_details where L_city='" + PrevCname + "'"; con.Close(); con.Open(); sqlcmd2 = new SqlCommand(edit_qry, con); sqlreader2 = sqlcmd2.ExecuteReader(); if (sqlreader2.HasRows) { string confirmvalue = Request.Form["confirm_value"]; //second msg("this record in the main table, are you sure to edit this?."); if (confirmvalue == "Yes") { con.Close(); con.Open(); string edit_update = "Update ledger_details set L_city='" + Cname + "' where L_city='" + PrevCname + "' "; sqlcmd2 = new SqlCommand(edit_update, con); sqlcmd2.ExecuteNonQuery(); con.Close(); con.Open(); string edit_update1 = "Update city_name set C_name='" + Cname + "' where C_ID='" + row_id + "'"; sqlcmd2 = new SqlCommand(edit_update1, con); sqlcmd2.ExecuteNonQuery(); txtbox_city.Text = string.Empty; } else { message( "You have cancelled to save the city name.."); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)