I have used integer array to Pass values to Oracle stored procedure
Data type in Oracle => Number
stored procedure :
create or replace PROCEDURE SP_ACCESS
(
UserID IN CHECKINOUT.USERID%TYPE
)
IS
BEGIN
INSERT INTO CHECKINOUT ("USERID")
VALUES (UserID);
COMMIT;
END;
ASP.NET Code :
int[] arrUID = UID.ToArray();
OracleConnection connection = new OracleConnection();
connection.ConnectionString = Obj.GetOraConnectionString();
OracleCommand command = new OracleCommand();
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "SP_ACCESS";
command.Parameters.Add("@USERID", OracleDbType.Int32);
command.Parameters[0].Value = arrUID;
connection.Open();
command.ExecuteNonQuery();
While executing i got the following error:
Unable to cast object of type 'System.Int32[]' to type 'System.IConvertible'.