473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ADO.NET Parameters only work once !!

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
4 1428
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm...
13
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
33
by: hermit_crab67 | last post by:
Can someone explain to a C newbie why this doesn't work as I expect it to work? (expectations clearly outlined in the printf statement in main routine) OS: Linux 2.4.26 GCC: 2.95.4 void...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
2
by: Hexman | last post by:
Hello All, Well I'm stumped once more. Need some help. Writing a simple select and update program using VB.Net 2005 and an Access DB. I'm using parameters in my update statement and when trying...
6
by: Joe | last post by:
Hi, I’ve lurked for a bit and certainly hope you folks can be as much help to me as you have been to others. My problem is basically trying to query several results in a single field (“or” type)...
7
by: Ceebaby via AccessMonster.com | last post by:
Hi All Here's hoping someone can help me with this. I have a report based on a query where the criteria for 4 of the fields is set from an unbound form. I want the user to be able to select any...
3
by: bockyweez | last post by:
Let me start off by stating that I use Access, but have limited knowledge in SQL... I do have a good understanding of programming (C++) though, so I can follow the logic behind it. But I use dirty...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.