shireenrao
Active member
Hello
I am trying to implement stored procedures with my vb.net application. In one part my stored procedure returns -1 if login fails. My code is -
now from vb.net how should I invoke this procedure?
I have some idea....
This is what I think I need to do..
Now how do I pass the parameters to myCommand, and how do I get the result?
Thanks
Srini
I am trying to implement stored procedures with my vb.net application. In one part my stored procedure returns -1 if login fails. My code is -
CREATE OR REPLACE PROCEDURE LOGIN_SP
( USRNAME IN VARCHAR2, PASSWD IN VARCHAR2, ret_value out number)
AS
cnt number := 0;
BEGIN
ret_value := 0;
SELECT count(*) into cnt
FROM USERS WHERE USERNAME = USRNAME AND PASSWORD = PASSWD;
exception
when NO_DATA_FOUND then
ret_value := 1;
END;
now from vb.net how should I invoke this procedure?
I have some idea....
This is what I think I need to do..
Dim myConnString As String = "SERVER=myserver;USER ID=me;PASSWORD=myself"
Dim myConnection As New OracleConnection(myConnString)
Dim myCommand As New OracleCommand("LOGIN_SP", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Now how do I pass the parameters to myCommand, and how do I get the result?
Thanks
Srini