i was getting an error :Column name or number of supplied values does not match table definition.
Line 23: cmd.ExecuteNonQuery();
-------------------
this is my c# code
protected void Button1_Click(object sender, EventArgs e)
{
{
string gend = RadioButtonList1.SelectedItem.ToString();
con.Open();
con.Open();
SqlCommand cmd = new SqlCommand("INSERT into OwnerReg VALUES('" + TextBox1.Text + "',
'" + TextBox2.Text + "', '" + TextBox7.Text + "',
'" + gend + "','" + TextBox3.Text + "','" + TextBox4.Text + "',
'" + TextBox5.Text + "','" + TextBox6.Text + "')", con);
cmd.ExecuteNonQuery();
'" + TextBox2.Text + "', '" + TextBox7.Text + "',
'" + gend + "','" + TextBox3.Text + "','" + TextBox4.Text + "',
'" + TextBox5.Text + "','" + TextBox6.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
Label16.Text = "Registered Successfully....";
}
--------------------------------------------------------
Data base table: OwnerReg
Username nvarchar(50),Password nvarchar(50),ConfirmPassword nvarchar(50),Gender nvarchar(50),DOB nvarchar(50),
Email nvarchar(MAX),MobileNO nvarchar(50),Address nvarchar(MAX)
plz help me...
Shuvojit HalderPosted Jun 22, 2015, 3:07 AM
navya bPosted Jun 22, 2015, 6:47 AM
Jaipal ReddyPosted Jun 22, 2015, 6:00 AM
Jaipal ReddyPosted Jun 22, 2015, 5:33 AM
Upendra Pratap ShahiPosted Jun 22, 2015, 5:06 AM