How to run a Stored Procedure using VB.NET and ODBC ?
394330May 27 2003 — edited May 27 2003Hello,
I need to run a Stored Procedure using ODBC with VB.NET but I get the following error:
[42000][Microsoft][ODBC Driver for Oracle][Oracle]ORA-00900: Invalid Sql-Statement
This is my Connection and Command:
Dim co As New OdbcConnection
("DSN=Test;UID=test;PWD=test;SERVER=aiv;")
Dim blobCmd As New OdbcCommand("InsertBlob")
This Stored Procedure has two parameters: Number and a varchar2. This is the rest of the code:
co.Open()
blobCmd.Connection = co
blobCmd.CommandType = CommandType.StoredProcedure
blobCmd.Parameters.Add("p_Id", OdbcType.Int, 20).Value = a
blobCmd.Parameters.Add("p_FileName", OdbcType.Char,100)
.Value = TextBox2.Text
blobCmd.ExecuteNonQuery()
co.Close()
Best Regards