Does anyone have problem of running stored procedure from VB .NET using the
ODBC driver, The OleDB driver work OK with the same Stored Procedure, also
the ASP work OK with that same Stored Procedure.
Here is the VB .NET Code
Dim constr as String =
"DSN=UPLUS;UID=db2admin;PWD=office;MODE=SHARE;DBAL IAS=UPLUS;PATCH2=6;PATCH1=
1024;LOBMAXCOLUMNSIZE=1048575;LONGDATACOMPAT=1;"
Dim OConnection as New System.Data.ODBC.ODBCConnection(constr)
Dim OCommand As New System.Data.ODBC.ODBCCommand("InsertAreturn10",
OConnection)
OCommand.CommandType = CommandType.StoredProcedure
OConnection.open()
OCommand.ExecuteNonQuery()
OConnection.close()
Produce the error
ERROR [42601] [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token
"END-OF-STATEMENT" was found following "InsertAreturn10". Expected tokens
may include: "JOIN <joined_table>". SQLSTATE=42601
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.Odbc.OdbcException: ERROR [42601] [IBM][CLI
Driver][DB2/NT] SQL0104N An unexpected token "END-OF-STATEMENT" was found
following "InsertAreturn10". Expected tokens may include: "JOIN
<joined_table>". SQLSTATE=42601
Where as the following code (OleDB driver) run fine
Dim constr as String ="Provider=IBMDADB2.1;Password=office;Persist Security
Info=True;User ID=db2admin;Data Source=UPLUS"
Dim OConnection as New System.Data.OleDb.OleDbConnection(constr)
Dim OCommand As New System.Data.OleDB.OleDbCommand("InsertAreturn10",
OConnection)
OCommand.CommandType = CommandType.StoredProcedure
OConnection.open()
OCommand.ExecuteNonQuery()
OConnection.close()