I am creating registration Form, here's the code
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionString"].ConnectionString);
con.Open();
string insCmd = "Insert into Registration(UserName, Password, EmailAdress, FullName, Country) vaues (@UserName, @Password, @EmailAddress, @FullName, @Country)";
SqlCommand insertUser = new SqlCommand(insCmd, con);
insertUser.Parameters.AddWithValue("@Password", TextBoxPass.Text);
insertUser.Parameters.AddWithValue("@EmailAddress",TextBoxEA.Text );
insertUser.Parameters.AddWithValue("@FullName",TextBoxFN.Text);
insertUser.Parameters.AddWithValue("@Country", DropDownListCountry.SelectedItem.ToString());
try
{
insertUser.ExecuteNonQuery();
con.Close();
Response.Redirect("Login.aspx");
}
catch (Exception er)
{
Response.Write("<b>Something is not going good.. Please try again..</b>");
}
finally
{
// Other Action
}
}
}
But when i want to register a new user it gives me the catch statement error.
Something is not going good.. Please try again..
please hep