S
SammyBar
Hi,
I'm developing a new .NET application but using the same stored procedures
(Sql Server 2000) that are in use by an old client server application. The
problem is that it is common when refactoring stored procedures, to change
the name of the parameters. It was not a problem since the old application
uses ODBC and the parameters are called by position, not by name. But
ADO.NET requires to me to specify parameters by name
parm = cmd.Parameters.Add("@ParamName", SqlDbType.Int);
Then when the sp get revised and updated to our new coding standard
(@ParamName will be renamed to @nParamName) it will break my code.
Is it any way I can specify the parameters by position, something like:
parm = cmd.Parameters.Add(0, SqlDbType.Int);
Any hint is welcomed.
Thanks in advance
Sammy
I'm developing a new .NET application but using the same stored procedures
(Sql Server 2000) that are in use by an old client server application. The
problem is that it is common when refactoring stored procedures, to change
the name of the parameters. It was not a problem since the old application
uses ODBC and the parameters are called by position, not by name. But
ADO.NET requires to me to specify parameters by name
parm = cmd.Parameters.Add("@ParamName", SqlDbType.Int);
Then when the sp get revised and updated to our new coding standard
(@ParamName will be renamed to @nParamName) it will break my code.
Is it any way I can specify the parameters by position, something like:
parm = cmd.Parameters.Add(0, SqlDbType.Int);
Any hint is welcomed.
Thanks in advance
Sammy