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. Database & SysAdmin
  3. Database
  4. run dynamic sql [mysql]

run dynamic sql [mysql]

Scheduled Pinned Locked Moved Database
databasequestionmysql
6 Posts 5 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.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    Hi, I have a website with a textbox.. user will write the sql query in the textbox.. how can I execute the code on mysql? Thanks,

    C R H R 4 Replies Last reply
    0
    • J Jassim Rahma

      Hi, I have a website with a textbox.. user will write the sql query in the textbox.. how can I execute the code on mysql? Thanks,

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      With crossed fingers. :)

      Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

      1 Reply Last reply
      0
      • J Jassim Rahma

        Hi, I have a website with a textbox.. user will write the sql query in the textbox.. how can I execute the code on mysql? Thanks,

        R Offline
        R Offline
        RyanEK
        wrote on last edited by
        #3

        I suggest you read up on SQL Injection

        1 Reply Last reply
        0
        • J Jassim Rahma

          Hi, I have a website with a textbox.. user will write the sql query in the textbox.. how can I execute the code on mysql? Thanks,

          H Offline
          H Offline
          Hiren solanki
          wrote on last edited by
          #4

          That's not a good practice But If you want to go ahead with this only then I can provide you little suggestion. Just Put you query inside Execute() and give SqlCommand To Execute.

          Regards, Hiren. Microsoft Dynamics CRM My Recent Article: - Way to know which control have raised PostBack[^]

          1 Reply Last reply
          0
          • J Jassim Rahma

            Hi, I have a website with a textbox.. user will write the sql query in the textbox.. how can I execute the code on mysql? Thanks,

            R Offline
            R Offline
            RaviRanjanKr
            wrote on last edited by
            #5

            Very simple, you need to embedded texts of textbox in the paramater of SQLCommand function and then pass connection object and then Execute it.

            J 1 Reply Last reply
            0
            • R RaviRanjanKr

              Very simple, you need to embedded texts of textbox in the paramater of SQLCommand function and then pass connection object and then Execute it.

              J Offline
              J Offline
              Jassim Rahma
              wrote on last edited by
              #6

              Hi, I tried it and it's working BUT it's just executing the first query so f i type any other quesry it will just show the first query result with no error unless i signout my application or restart it.. why is this? here is the code:

              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