Monday, November 16, 2009

Personal DOTNET

SAVE


protected void btnsubmit_Click(object sender, EventArgs e)
{
string qry = " ";
try
{
cn = new SqlConnection("Data Source=SARANYA;Initial Catalog=elab;Integrated Security=True;Pooling=False");
cn.Open();
qry = "Insert into usercreation(EmpName,Role,Password,ConfirmPassword) values('" + txename.Text + "','" + ddrole.SelectedItem.Text + "','" + txpwd.Text + "','" + txcpwd.Text + "')";
cm = new SqlCommand(qry, cn);
cm.ExecuteNonQuery();
clear();
lb.Text = "Record Inserted Successfully";
}
catch
{
lb.Text = "Server Busy;Try after sometime!";
}
finally
{
cn.Close();
}

}

No comments:

Post a Comment