473,791 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Table s("Uplifts").Ro ws(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.Updat e(dsUplifts, "Uplifts")
thanx,

Ste..
Nov 20 '05 #1
4 1441
You need to catch the error and display the actual message.

"Ste" <st*@home.com > wrote in message
news:bu******** ***********@new s.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.Table s("Uplifts").Ro ws(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.Updat e(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******** ******@TK2MSFTN GP11.phx.gbl...
You need to catch the error and display the actual message.

"Ste" <st*@home.com > wrote in message
news:bu******** ***********@new s.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.Table s("Uplifts").Ro ws(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.Updat e(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.publi c.dotnet.framew ork.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******** ***********@new s.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******** ******@TK2MSFTN GP11.phx.gbl...
You need to catch the error and display the actual message.

"Ste" <st*@home.com > wrote in message
news:bu******** ***********@new s.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.Table s("Uplifts").Ro ws(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.Updat e(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
4380
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 stuck here.
13
10448
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 change the parameter data types to the actual data type such as varchar(10), etc., the stored procedure takes less that a second to return records. The user defined types are mostly varchar, but some others such as int. They are all input type...
7
21637
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 server ? Is it possible to use parameters in pass-through queries ? An additional question: Is it possible to connect to a database on MySQL or PostgreSQL using ADO ? Is it possible to execute pass-through queries with parameters, using ADO...
33
2290
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 modify_pointer(char *); int main(int argc, char *argv) {
19
3882
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 ReuseParameterValuesOnRefresh="True" in a viewer, but it still doesn't work. Did anyone run into this problem. What's the solution? Please help. Thank you
14
3275
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 make things simpler and better readable I'd make all default parameters named parameters so that you can decide for yourself which one to pass and which not, rather than relying on massively overlaoded methods which hopefully provide the best...
2
2629
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 to update a record, I get a "No value given for one or more parameters." error message. I use a Select with parameters and an Update with parameters. The select works fine. I thought I've tried everything (evidently not) to get this working. ...
6
1992
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) but I would like to do so as a parameter so it prompts me when I open the report. I am working with MS Access 2000. Here is my situation.
7
4014
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 combination of the combo boxes, some might not be selected etc etc. ie they may want to select the area and ward to show on the report but not the case officer or the property type
3
1609
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 but quick methods of doing things in Access that work but probably isn't the best or simiplist methods because I don't know how to do them. Okay, the problem is that I use a lot of reports in Access that runs off of a query (Query2) that runs off of...
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10427
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9995
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.