jimfollett1
New member
- Joined
- Nov 28, 2006
- Messages
- 2
- Programming Experience
- Beginner
Heya,
Can anyone put me on the right track with respect to the error I'm getting whilst calling an Oracle Stored proc from vb.net 2005. I have been trawling through code examples high and low, but to no avail. Here's my calling code to a simple, one output, stored proc. It gives the error whilst calling "cmd2.ExecuteScalar":
cheers,
James
VB.NET code
Stored Proc:
Can anyone put me on the right track with respect to the error I'm getting whilst calling an Oracle Stored proc from vb.net 2005. I have been trawling through code examples high and low, but to no avail. Here's my calling code to a simple, one output, stored proc. It gives the error whilst calling "cmd2.ExecuteScalar":
However, when I changed the provider to System.Data.OleDb it worked fine - any theories?PLS-00306: wrong number or types of arguments in call to 'TEST'
cheers,
James
VB.NET code
VB.NET:
Dim conn2 As New System.Data.OracleClient.OracleConnection("...")
Dim cmd2 As New System.Data.OracleClient.OracleCommand
conn2.Open()
cmd2.Connection = conn2
cmd2.CommandType = CommandType.StoredProcedure
cmd2.CommandText = "test"
cmd2.Parameters.Add("Id", OracleClient.OracleType.Int32, 9)
cmd2.Parameters("Id").Direction = ParameterDirection.Output
cmd2.ExecuteScalar()
Dim j As Integer = CInt(cmd2.Parameters("").Value)
conn2.Close()
Stored Proc:
VB.NET:
PROCEDURE test
(outId out number)
IS
BEGIN
SELECT SEQ.nextval into outId FROM dual;
END test;
Last edited by a moderator: