views:

1469

answers:

2

I am writing a C# Windows Forms application which calls Oracle stored procedures.

I chose to use typed datasets in the application, these correctly populate various datagrids, but I am having trouble when invoking the UpdateCommand or the InsertCommand. I have manually coded these commands because a) I am using Oracle stored procedures and b) I don't trust CommandBuilder ;)

I am using VS2008 and Oracle 9i

I don't have trouble executing stored procedures in SQL Server or Oracle when simply calling them from the .ExecuteNonQuery command; neither do I have problems executing SQL statements directly and updating the database. The problems only arise when executing the changed rows with OracleDataAdapter.Update(). I am specifying the correct set of rows (added, changed etc.)

The main error I am getting (after a lot of experimentation with increasingly simpler SPs finishing with just one int parameter) is "PLS-00306: wrong number or type of arguments in call to 'PROCNAME'"

I have tried prefixing the Oracle parameter both with ':' and without.

Suffice to say I am losing the will to live. Has anyone any more ideas I could try next?

Thanks

+1  A: 

Are you using Oracle's ODBC driver, or Microsoft?

Stick with the Oracle driver.

Try using your simple test case with a text parameter instead of an integer. Without seeing your code, it could be that you need to pass in a long int to the procedure. Trying a simple text parameter could verify that the problem is in variable typing.

DCookie
A: 

Hi, thanks for the reply, its the Oracle 9.02.0.0 driver, SQORA32.DLL. It has always worked fine for everything else I have done... guess you have put a seed of doubt in my mind!

John_D
Well, actually, I've seen more problems with using the MS driver. Another thing to try is to use a bare-bones case using a text argument instead of integer.
DCookie