protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con;
con = new SqlConnection(ConfigurationManager.AppSettings["connect"]);
con.Open();
SqlCommand cmd;
cmd = new SqlCommand("Insert into registration (name,class) values('" + TextBox1.Text + "','" + TextBox2.Text + "')", con);
try
{
con.Open();
cmd.ExecuteNonQuery();
Label14.Text = "Data inserted successfully";
con.Close();
refress();
}
catch (Exception ex)
{
Label14.Text = ex.Message;
}
}