ADO.NET Parameters only work once !!

S

Ste

Hi group,
i'm having a problem with ADO.NET and VB.NET. I have created a
DataAdapter and a Dataset, and all the commands necessary. I have created
parameters for the update, insert and delete commands and these work
fine..... THE FIRST TIME !! On any subsequent attempt to update data in the
table, my program ends with a "system error"

Here is my source code.... any ideas... anyone ?
(the parameters code is in the "designer generated section")


Dim drTest As DataRow

'assign current row to drTest
drTest =
dsUplifts.Tables("Uplifts").Rows(lvCollection.SelectedItems(0).Index)

'update fields
drTest.Item(0) = ""
drTest.Item(2) = "01"
drTest.Item(2) = strInstrNumber
drTest.Item(3) = txtLine1.Text
drTest.Item(4) = txtLine2.Text
drTest.Item(5) = txtLine3.Text

'update db
daUplifts.Update(dsUplifts, "Uplifts")


thanx,

Ste..
 
S

Ste

Thanks Marina,
i have captured the error and the actual error
message is:

ERROR [07002] [IBM][iSeries Access ODBC Driver]Wrong number of parameters.

any ideas ?
 
A

Armin Zingler

Ste said:
Thanks Marina,
i have captured the error and the actual
error
message is:

ERROR [07002] [IBM][iSeries Access ODBC Driver]Wrong number of
parameters.

any ideas ?


Only a hint: Next time you'd better ask in the ADO.NET group:
microsoft.public.dotnet.framework.adonet because there are the database
specialists (which does not mean here are none!).
 
J

Jay B. Harlow [MVP - Outlook]

STe,
In addition to Marina's suggestions.

I currently do not use VB.NET & the iSeries (AS/400), however I remember
this:

You need to be on Client Access V5R2 to be fully supported from .NET.

http://www-1.ibm.com/servers/eserver/iseries/access/oledb/index.html

http://www-912.ibm.com/n_dir/nas4ap...6be4003c8957?OpenDocument&Highlight=2,ii13341

The above links are from June 3rd, not sure if there are more current
versions with better support...

Hope this helps
Jay


Ste said:
Thanks Marina,
i have captured the error and the actual error
message is:

ERROR [07002] [IBM][iSeries Access ODBC Driver]Wrong number of parameters.

any ideas ?


Marina said:
You need to catch the error and display the actual message.
created
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top