You are on page 1of 1

string strcon = @"Data Source=.

\sqlexpress;Initial
Catalog=CMS;Integrated Security=True;Pooling=False";
SqlConnection con = new SqlConnection(strcon);
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "INSERT INTO registration
(FName,LName,UserName, Password, RePassword, SecQ,
Answer,Recovmail,Location,VerificationCode)VALUES(@FName,@LName,@UserNam
e,@Password,@RePassword,@SecQ,@Answer,@Recovmail,@Location,@Verification
Code)";
cmd.Parameters.AddWithValue("@FName", TxtName.Text);
cmd.Parameters.AddWithValue("@LName", LastName.Text);
cmd.Parameters.AddWithValue("@UserName", TxtUserName.Text);
cmd.Parameters.AddWithValue("@Password", TxtPassword.Text);
cmd.Parameters.AddWithValue("@RePassword", TxtRePassword.Text);
cmd.Parameters.AddWithValue("@Answer", IdentityAnswer.Text);
cmd.Parameters.AddWithValue("@SecQ", SecQ.Text);
cmd.Parameters.AddWithValue("@Location", loca.Text);
cmd.Parameters.AddWithValue("@Recovmail", SecondaryEmail.Text);
cmd.Parameters.AddWithValue("@VerificationCode",
newaccountcaptcha.Text);
cmd.ExecuteNonQuery();
con.Close();

You might also like