Use the below code..
protected void Button1_Click1(object sender, EventArgs e)
{
try
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);
con.Open();
string insertQuery = "insert into UserData([User Name],Email,Password,Country)values(@Uname,@Email,@Password,@Country)";
SqlCommand com = new SqlCommand(insertQuery, con);
com.Parameters.AddWithValue("@Uname", TextBoxUN.Text);
com.Parameters.AddWithValue("@email", TextBoxEmail.Text);
com.Parameters.AddWithValue("@password", TextBoxPass.Text);
com.Parameters.AddWithValue("@country", DropDownListCountry.SelectedItem.ToString());
com.ExecuteNonQuery();
Response.Redirect("Mnager.aspx");
Response.Write("Registration is Successfull..........");
}
catch (Exception ex)
{
Response.Write("Error:" + ex.ToString());
}
finally
{
con.Close();
}
}