Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- if (Page.IsValid)
- {
- SqlConnection con = new SqlConnection();
- con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["cn"].ConnectionString;
- if (con.State == ConnectionState.Closed)
- {
- con.Open();
- }
- SqlCommand cmd = new SqlCommand();
- cmd.Connection = con;
- cmd.CommandText = "save_contact";
- cmd.Parameters.Add("@name", SqlDbType.VarChar, 50).Value = TextBox1.Text;
- cmd.Parameters.Add("@mobile", SqlDbType.Char, 11).Value = TextBox2.Text;
- cmd.Parameters.Add("@eid", SqlDbType.VarChar, 50).Value = TextBox3.Text;
- cmd.Parameters.Add("@address", SqlDbType.VarChar, 100).Value = TextBox4.Text;
- //cmd.Parameters.Add("@pid", SqlDbType.Int).Value = pid;
- cmd.CommandType = CommandType.StoredProcedure;
- cmd.ExecuteNonQuery();
- con.Close();
- cmd.Dispose();
- string jquery = "showme();";
- ClientScript.RegisterStartupScript(typeof(Page), "a key",
- "<script type="text/javascript">" + jquery + "</script>"
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement