|
-
Jul 29th, 2002, 09:37 AM
#1
Thread Starter
Member
VB .NET probs with ADO.NET
Hi,
I am having some problems using the .NET dataAdapter to insert/update a MSAccess2k database.
I add a new row to a dataset, then on calling the adapter update command, I get the following error
"No value given for one or more required parameters"
I've created the commandtext for the insert command:
VB Code:
"INSERT INTO Customer(DOB, Employer, Surname, HealthNotes, MemberNumber, Occupat" & _
"ion, PCityID, PhoneAH, PhoneBH, PhoneM, PPostCode, PStreetAddress, PSuburbID, Qu" & _
"estionID, RCityID, RPostCode, RStreetAddress, RSuburbID, Sex, GivenName) VALUES (?" & _
", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
Anybody have experience here ?
Thanks,
BG
-
Jul 29th, 2002, 09:47 AM
#2
are you using that insert statement exactly as it is shown?
What is the deal with the question marks?
-
Jul 29th, 2002, 10:12 AM
#3
Thread Starter
Member
I am basing that insert statement on the one setup by the wizard.
All the examples I have seen use the question marks in the value clause of the SQL.
I am also creating the select clause myself (because I need data from multiple tables), not extracting the entire table into the dataset.
If I add parameters to the parameter collection for the insert command object, I dont get the error, but the database is not updated at all.
Only if I hard code the values in the SQL statement manually does it do anything. Surely that defeats the purpose of the .NET dataAdapter functions?
BG
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|