I need to call stored procs in C # (.Net 2.0), sometimes using an ODBC connection, sometimes with SQLClient. In the future, we could also talk to Oracle.
My stored procedures have I / O parameters and a return value.
CREATE PROCEDURE myProc (@MyInputArg varchar(10), @MyOutputArg varchar(20) output) AS (...) return @@ERROR
My problem is that I cannot find a way to keep a team that can be shared by any client. I am using an IDbCommand object.
With an ODBC connection, I have to determine:
objCmd.CommandText = "? = CALL myProc (?,?)";
In the context of SQLclient:
objCmd.CommandText = "myProc";
I really do not want to disassemble my team, I am sure that there is a better way to get a general character.
To help people reproduce, you can find below how I made a general database connection. In my context, the provider object is determined from the configuration file.
Thank you for your time.
Regards, Thibaut.
source share