0

I am using VB2008 fr my project , I am having an error while inserting data in the sales form

The error is;:__

"Number of query values and destination fields are not the same".

Here is my code-:

Dim sql As String
    sql = "insert into sales (SalesId ,PropertyNo, SellerNo, BuyerNo, PropertyType, Region, Commission, SellingPrice, DateOfSale) values ('" & SalesIdTextBox.Text & "', '" & PropertyNoTextBox1.Text & "','" & SellerNoTextBox.Text & "','" & BuyerNoTextBox1.Text & "','" & PropertyTypeTextBox1.Text & "','" & RegionTextBox.Text & "','" & CommissionTextBox.Text & "','" & SellingPriceTextBox1.Text & "', '" & DateOfSaleDateTimePicker.Value.Date & "',  0)"
UpdateRecord(sql)

Thanks

Edited by MuddHizb: Update

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by MuddHizb
0

You have 9 columns listed in the SQL statement but ten inputs in the values section including the zero at the end. The zero has no matching column specified.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.