Calling an SP with Param...
-
Calling by the other way: Is it possible to call a stored procedure WITH PARAM from .net WITHOUT using "AddParams" ? I mean we should be able to call(exec) the SP just like we do in the query analyser. I'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.
*
-
Calling by the other way: Is it possible to call a stored procedure WITH PARAM from .net WITHOUT using "AddParams" ? I mean we should be able to call(exec) the SP just like we do in the query analyser. I'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.
*
Theoretically you could do this by setting the CommandType to Text and then issue the command directly. I would strongly advise you against doing this however. This is not a good design, and it is certainly not a robust or secure design. By passing in parameters as part of a string, you open yourself right up for Sql Injection attacks. I cannot see any reason, apart from convenience, why you would do this. Use command parameters - they are much better for your needs.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.