I have made sign up button wherein the button accepts data from user and when the user clicks on sign up button then it stores the data in Sign table of databse.
The code for sign up button is :
Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
con.Open()
cmd = New SqlCommand("insert into sign values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')", con)
cmd.ExecuteNonQuery()
End Sub
But,after running web page ,and entering all details and click on sign up button ,it directs me to the code section and gives error for this line :
cmd.ExecuteNonQuery()
The Insert Error is:
SqlException was unhandled by user code.
Column name or number of supplied values does not match table definition.
IAmateur
Member
96 Points
388 Posts
sign up button
Apr 04, 2012 04:54 PM|LINK
Asp.net 3.5 using VB.
I have made sign up button wherein the button accepts data from user and when the user clicks on sign up button then it stores the data in Sign table of databse.
The code for sign up button is :
Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
con.Open()
cmd = New SqlCommand("insert into sign values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "')", con)
cmd.ExecuteNonQuery()
End Sub
But,after running web page ,and entering all details and click on sign up button ,it directs me to the code section and gives error for this line :
cmd.ExecuteNonQuery()
The Insert Error is:
SqlException was unhandled by user code.
Column name or number of supplied values does not match table definition.
Time to go Long way...