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. Access SQL in code behind

Access SQL in code behind

Scheduled Pinned Locked Moved ASP.NET
tutorialcsharpdatabase
4 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.
  • R Offline
    R Offline
    RX Maverick
    wrote on last edited by
    #1

    I normally just use code behind to create a SQL statement and assign it to a SqlDataSource SelectCommand then to a Repeater, GridView, etc. So far it's all worked great. Now I need to access the data ans manipulate it in the code behind (so far I use VB.NET but any language will work). I'm at a loss for how to do this. I've done what I want to back in the day of ASP, but I don't want to use old code (or the aspcompat=true statement). Anyone have a good page I could read or a quick example.

    E 1 Reply Last reply
    0
    • R RX Maverick

      I normally just use code behind to create a SQL statement and assign it to a SqlDataSource SelectCommand then to a Repeater, GridView, etc. So far it's all worked great. Now I need to access the data ans manipulate it in the code behind (so far I use VB.NET but any language will work). I'm at a loss for how to do this. I've done what I want to back in the day of ASP, but I don't want to use old code (or the aspcompat=true statement). Anyone have a good page I could read or a quick example.

      E Offline
      E Offline
      ednrgc
      wrote on last edited by
      #2

      Are you talking about creating a a dynamic SQL statement, or manipulate the data?

      R 1 Reply Last reply
      0
      • E ednrgc

        Are you talking about creating a a dynamic SQL statement, or manipulate the data?

        R Offline
        R Offline
        RX Maverick
        wrote on last edited by
        #3

        It will be a static SQL Select statement but I want to run it, assign it to an array and manipulate it all in code behind. Then assign the array to a GridView, Repeater, etc. to display.

        E 1 Reply Last reply
        0
        • R RX Maverick

          It will be a static SQL Select statement but I want to run it, assign it to an array and manipulate it all in code behind. Then assign the array to a GridView, Repeater, etc. to display.

          E Offline
          E Offline
          ednrgc
          wrote on last edited by
          #4

          Create a DataTable, and populate that from your code behind. Then do your manipulation, and set the datasource, and databind.

          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