Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to change the stored procedure dynamically?

How to change the stored procedure dynamically?

Scheduled Pinned Locked Moved ASP.NET
csharptutorialquestionasp-netdatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Affan Toor
    wrote on last edited by
    #1

    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!

    N 1 Reply Last reply
    0
    • A Affan Toor

      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!

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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.


      My Website | Ask smart questions

      A 1 Reply Last reply
      0
      • N N a v a n e e t h

        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.


        My Website | Ask smart questions

        A Offline
        A Offline
        Affan Toor
        wrote on last edited by
        #3

        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!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups