protected void btnsubmit_Click(object sender, EventArgs e)
{
string name = TXTNNAME.Text.ToString().Trim();
string gender = ddlgender.SelectedValue.ToString().Trim();
string age = txtage.Text.ToString().Trim();
string address = txtadd.Text.ToString().Trim();
string phone = txtphone.Text.ToString().Trim();
string password = txtpass.Text.ToString().Trim();
string package="";
if(chkpack.Checked==true)
{
package=chkpack.Text.ToString().Trim();
}
else
{
package = chkpack1.Text.ToString().Trim();
}
SqlConnection tcon= new SqlConnection(ConfigurationManager.AppSettings["templecon"].ToString().Trim());
SqlCommand cmdlog=new SqlCommand("logininsert", tcon);
cmdlog.CommandType = CommandType.StoredProcedure;
cmdlog.Parameters.Add("@name", SqlDbType.VarChar).Value = TXTNNAME.Text.ToString().Trim();
cmdlog.Parameters.Add("@gender", SqlDbType.VarChar).Value = ddlgender.SelectedValue.ToString().Trim();
cmdlog.Parameters.Add("@age", SqlDbType.Int).Value = txtage.Text.ToString().Trim();
cmdlog.Parameters.Add("@address", SqlDbType.VarChar).Value = txtadd.Text.ToString().Trim();
cmdlog.Parameters.Add("@phone", SqlDbType.BigInt).Value = txtphone.Text.ToString().Trim();
cmdlog.Parameters.Add("@password", SqlDbType.NVarChar).Value = txtpass.Text.ToString().Trim();
cmdlog.Parameters.Add("@package", SqlDbType.VarChar).Value =package;
tcon.Open();
cmdlog.ExecuteNonQuery();
tcon.Close();
}
No comments:
Post a Comment