August 4th, 2008, 08:57 PM
"System.data.odbc.odbcexception ERROR  [IBM][iSeries Access ODBC Driver]Wrong
I got a weird error which iam struggling to fix for soo many days. I need u guys help. please help me. I got a web service in win 2003 server which access the database to do insert operation (dataadapter.update(dataset)). This webservice is called by 2 applications. one is client server application(winform poped up in browser at client side takes input file and processes to a dataset and calls webservice to insert into database using (dataadapter.update(dataset)). the second application(asp.net app) rests in same server calls webservice and does same operation inserting into database using same statement works fine). The problem arose when i migrated from .net 1.1 to .net 2.0 framework.
The error message iam getting is:
"System.data.odbc.odbcexception ERROR  [IBM][iSeries Access ODBC Driver]Wrong number of parameters".
Please help me. iam inserting it into db2 database(as400) . The server has v5r4 client access software. If u need further info please let me know.
I caught the dataset just before the insert operation and wrote it to a xml to check the condition of dataset(to verify any damage in network). It looks fine and i used same dataset to build insert statements to enter manually into database. So i believe there is some security or access provider issue.
August 11th, 2008, 09:33 AM
Re: "System.data.odbc.odbcexception ERROR  [IBM][iSeries Access ODBC Driver]Wrong
I seems that your command object has passed more parameters. Check your Command object if it has the same parameters as your Stored Procedure. Or you can just post your SP code and your App code and we can point where did things went wrong
Hope it helps
October 16th, 2012, 11:15 AM
Re: "System.data.odbc.odbcexception ERROR  [IBM][iSeries Access ODBC Driver]Wr
I had the same problem.
A DECIMAL(x,y) DB field may confuse the statement. For them you must specify precision and scale like this:
I noticed that sometimes the statement can work without specifying them, but only in the particular case when the value you set for the parameter has exactly precision 9 and scale 6; for instance 43.972503 is ok, 42.974730 is not, because of the trailing zero(!).
par = insert.Parameters.Add("?RPLATI", OdbcType.Decimal);
par.Precision = 9;
par.Scale = 6;
Click Here to Expand Forum to Full Width