hello ,
how to add after update like user name has been update
Name: kankon
City: Hawally stat: hawally
Country:Kuwait
my code is HTML
<script>
function alertupdate() {
swal("تم تحديث بيانات الموظف بنجاح", '', "success",);
}
</script>
Code Behind c#
protected void Button28_Click(object sender, EventArgs e)
{
if (Uname.Text == String.Empty)
{
ClientScript.RegisterStartupScript(this.GetType(), "randomtext", " alertmecheck()", true);
}
else
{
String constring = ConfigurationManager.ConnectionStrings["cmConnectionString"].ConnectionString;
SqlConnection sqlcon = new SqlConnection(constring);
String pname = "update_PC";
sqlcon.Open();
SqlCommand com = new SqlCommand(pname, sqlcon);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@name", Uname.Text.ToString());
if (!string.IsNullOrEmpty(ddlCities.Text.Trim()))
{
com.Parameters.AddWithValue("@Cities", ddlCities.SelectedItem.Text.ToString());
}
if (!string.IsNullOrEmpty(ddlCountries.Text.Trim()))
{
com.Parameters.AddWithValue("@Countries", ddlCountries.SelectedItem.Text.ToString());
}
if (!string.IsNullOrEmpty(filenumber.Text.Trim()))
{
com.Parameters.AddWithValue("@fileid", Ufileid.Text.ToString());
}
if (!string.IsNullOrEmpty(civilid.Text.Trim()))
{
com.Parameters.AddWithValue("@civilid", Ucivilid.Text.ToString());
}
if (!string.IsNullOrEmpty(ddlStates.Text.Trim()))
{
com.Parameters.AddWithValue("@States", ddlStates.SelectedItem.Text.ToString());
}
com.ExecuteNonQuery();
ClientScript.RegisterStartupScript(this.GetType(), "randomtext", " alertupdate()", true);
sqlcon.Close();
}
}