How to change the stored procedure dynamically?
-
Hi, Hope every one is fine. i am building a web site in ASP.NET 2.0 and C#. i want to update my stored procedure at runtime according to user's choice. is it possible? i found some code which does this but it doesnt change the procedure physically, i mean it changes at runtime but when i stop application it again shows the old command text. Kindly guide how can i perform this task. Thanks in advance... Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
-
Hi, Hope every one is fine. i am building a web site in ASP.NET 2.0 and C#. i want to update my stored procedure at runtime according to user's choice. is it possible? i found some code which does this but it doesnt change the procedure physically, i mean it changes at runtime but when i stop application it again shows the old command text. Kindly guide how can i perform this task. Thanks in advance... Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
Affan Toor wrote:
i want to update my stored procedure at runtime according to user's choice. is it possible?
Strange. Why you need this ? if you are updating stored procedure dynamically, better to use query directly. If you want to do this, write procedure creation code in SQLCommand and execute it. If procedure exist drop it and exete the create procedure statements.
-
Affan Toor wrote:
i want to update my stored procedure at runtime according to user's choice. is it possible?
Strange. Why you need this ? if you are updating stored procedure dynamically, better to use query directly. If you want to do this, write procedure creation code in SQLCommand and execute it. If procedure exist drop it and exete the create procedure statements.
Thanks for reply, my problem is solved! i found a way to dynamically change the contents of stored procedure. actually we can not pass a query directly to crystal report at runtime, thats why i wanted to pass query to stored procedure at runtime and then execute that procedure in crystal report. Regards, Affan Ahmad Toor
.................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!