在这里我要注册一个用户。最后我想检查是否注册成功然后需要转到下一页..我在 IF 条件中遇到错误
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=AAZZZ;Initial Catalog=DRDB;User ID=sa;Password=sa123");
SqlCommand cmd = new SqlCommand("UserRegistration_SP", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Firstname", TextBox1.Text);
cmd.Parameters.AddWithValue("@Lastname", TextBox2.Text);
cmd.Parameters.AddWithValue("@Username", TextBox3.Text);
cmd.Parameters.AddWithValue("@Password", TextBox4.Text);
cmd.Parameters.AddWithValue("@ConfirmPassword", TextBox5.Text);
cmd.Parameters.AddWithValue("@Address1", TextBox6.Text);
cmd.Parameters.AddWithValue("@Address2", TextBox7.Text);
cmd.Parameters.AddWithValue("@Address3", TextBox8.Text);
cmd.Parameters.AddWithValue("@Telephone", TextBox9.Text);
cmd.Parameters.AddWithValue("@Email", TextBox10.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
if (Registration == Successful)
{
Response.Redirect("Registration2.aspx");
}
else {
lblinfo.Text = "Some error has happend";
}
}