Hi, I am runningt the following stored proecdure and getting an error:-
Unhandled Exception: System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SP_ADD_USER'
This is the SP:-
The type of user_name/password is varchar2.
This is the vb.net code i'm using to execute the sp:-
I have tried to use fixed variables to pass in but i get the same error.
Any help much apreciated, i just cant seem to crack this one!
Alex
Unhandled Exception: System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SP_ADD_USER'
This is the SP:-
VB.NET:
CREATE OR REPLACE PROCEDURE sp_add_user
(
i_user_name IN tbl_user.user_name%TYPE,
i_password IN tbl_user.password%TYPE
)
IS
BEGIN
INSERT INTO TBL_USER (user_name, password) VALUES(i_user_name, i_password);
END;
/
show errors
/
This is the vb.net code i'm using to execute the sp:-
VB.NET:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
' create oracle
' create connection
Dim cn As OracleConnection = mtsmDba.getCn
Dim dbadpt As OracleDataAdapter = New OracleDataAdapter
Dim addUser As OracleCommand = New OracleCommand
'Dim user As String = "MRMAN"
'Dim pass As String = "bignuts"
With addUser
.Connection = mtsmDba.getCn
.CommandText = "sp_add_user"
.CommandType = CommandType.StoredProcedure
.Parameters.Add("username", OracleType.VarChar).Value() = Me.txtUserName.Text
.Parameters.Add("password", OracleType.VarChar).Value() = Me.txtPassword.Text
End With
mtsmDba.openDb()
' execute the function
addUser.ExecuteNonQuery()
mtsmDba.closeDb()
addUser.Dispose()
End Sub
End Class
I have tried to use fixed variables to pass in but i get the same error.
Any help much apreciated, i just cant seem to crack this one!
Alex