try
{
string str = "insert into employee(empid,empname,empgrade,empdept,empsal) values(" + TextBox1.Text + ",'" + TextBox2.Text + "','" + TextBox3.Text + "'," + TextBox4.Text + "," + TextBox5.Text + ")";SqlCommand cmd = new SqlCommand(str, cn);
cn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ee)
{ Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "alert('" + ee.Message + "');", true);
}