protected void RegistrationMember(object sender, WizardNavigationEventArgs e)
{
TextBox txtID = (TextBox)cuwRegistration.FindControl("UserName");
TextBox txtPass = (TextBox)cuwRegistration.FindControl("Password");
TextBox txtEmail = (TextBox)cuwRegistration.FindControl("Email");
TextBox txtQuestion = (TextBox)cuwRegistration.FindControl("Question");
TextBox txtAnswer = (TextBox)cuwRegistration.FindControl("Answer");
SqlConnection conRegister = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
SqlCommand cmdRegister;
conRegister.Open();
cmdRegister = new SqlCommand("INSERT INTO [Member](UserName, Password, Email, Question, Answer) VALUES (@ID, @Pass, @Email, @Ques, @Ans)", conRegister);
cmdRegister.Parameters.AddWithValue("@ID", txtID.Text);
cmdRegister.Parameters.AddWithValue("@Pass", txtPass.Text);
cmdRegister.Parameters.AddWithValue("@Email", txtEmail.Text);
cmdRegister.Parameters.AddWithValue("@Ques", txtQuestion.Text);
cmdRegister.Parameters.AddWithValue("@Ans", txtAnswer.Text);
cmdRegister.ExecuteNonQuery();
Roles.AddUserToRole(txtID.Text, "Member");
conRegister.Close();
}
Inside my own database database wasn't being insert, but in the ASP.Net Web Admin Tool was inserted and it doesn't no assign to any roles.