I have a function for inserting new data into a table but I'm receiving the following error:
Server Error in '/Contractors' Application.
Insert Error: Column name or number of supplied values does not match table definition.
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where
it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Insert Error: Column
name or number of supplied values does not match table definition.
An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using
the exception stack trace below.
The table conists of the following columns, they are all type char, expect ID is type int:
I'm not completely sure if I'm supposed to use the Param's for INSERT INTO clause, but here is the function I'm calling thats causing the error:
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
'Save the values from the details fields to the database
Dim updAdd As SqlCommand = New SqlCommand("INSERT INTO Contacts VALUES (@VendorNo, @DateIssued, @Surname, @FirstName, @ContactNumber, @Address)", conn)
Any help solving this issue would be greatly appreciated! It's got me confused thats for sure heh.