Gender storage in database
SqlConnection cnn = new SqlConnection(@"Data Source=.\sqlexpress;Initial Catalog=basoft;Integrated Security=True;Pooling=False");SqlCommand cmd = new SqlCommand("insert into Registration values('" +
TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text +
"','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" +
DropDownList1.SelectedValue + "','" + DropDownList2.SelectedValue + "','" +
DropDownList3.SelectedValue + "','" + TextBox8.Text + "','" + DropDownList4.SelectedValue + "','" + RadioButton1.checked.ToString() + "')", cnn);
cnn.Open();
var n = cmd.ExecuteNonQuery();
cnn.Close();
if (n == 1)
Response.Write("<script>alert('Registration Success');</script>");
else
Response.Write("<script>alert('Registration Failed');</script>");
{
sir from these code i am able to store the gender true and false my coulumn gender datatype is varchar sir how can i able to store male and female or m & f in database/