By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

ADO.NET Parameters only work once !!

P: n/a
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.Sele ctedItems(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..
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You need to catch the error and display the actual message.

"Ste" <st*@home.com> wrote in message
news:bu*******************@news.demon.co.uk...
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.Sele ctedItems(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..

Nov 20 '05 #2

P: n/a
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 ?
"Marina" <so*****@nospam.com> wrote in message
news:#M**************@TK2MSFTNGP11.phx.gbl...
You need to catch the error and display the actual message.

"Ste" <st*@home.com> wrote in message
news:bu*******************@news.demon.co.uk...
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.Sele ctedItems(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..


Nov 20 '05 #3

P: n/a
"Ste" <st*@home.com> schrieb
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!).
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

P: n/a
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...edb/index.html

http://www-912.ibm.com/n_dir/nas4apa...ight=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" <st*@home.com> wrote in message
news:bu*******************@news.demon.co.uk...
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" <so*****@nospam.com> wrote in message
news:#M**************@TK2MSFTNGP11.phx.gbl...
You need to catch the error and display the actual message.

"Ste" <st*@home.com> wrote in message
news:bu*******************@news.demon.co.uk...
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.Sele ctedItems(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..



Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.