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. General Programming
  3. Visual Basic
  4. How can I bind data to a database

How can I bind data to a database

Scheduled Pinned Locked Moved Visual Basic
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.
  • M Offline
    M Offline
    mghiassi
    wrote on last edited by
    #1

    I want to bind data in a Select Statement in a stored procedure in SQL Server 2005 to a GridView in Visual Basic 2005. I set the DataSourceID of the GridView to the Stored Procedure and in runtime Bind the Data with DataBind Method. But it dose not work. Please help me.

    D 1 Reply Last reply
    0
    • M mghiassi

      I want to bind data in a Select Statement in a stored procedure in SQL Server 2005 to a GridView in Visual Basic 2005. I set the DataSourceID of the GridView to the Stored Procedure and in runtime Bind the Data with DataBind Method. But it dose not work. Please help me.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      It sounds like you have some misconceptions about how all this works. Post the code you're using to get the data and bind the grid and we'll see if we can straighten it out. Is this an ASP.NET app or Windows Forms? You don't bind to a stored procedure. You call a stored procedure to return the records you want. The records end up in either a DataTable or some other bindable source. You then bind the grid to that record set.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        It sounds like you have some misconceptions about how all this works. Post the code you're using to get the data and bind the grid and we'll see if we can straighten it out. Is this an ASP.NET app or Windows Forms? You don't bind to a stored procedure. You call a stored procedure to return the records you want. The records end up in either a DataTable or some other bindable source. You then bind the grid to that record set.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        M Offline
        M Offline
        mghiassi
        wrote on last edited by
        #3

        I wrote this code and in .aspx.vb i write this code Protected Sub Page_Load(Parameters) GridView1.DataBind End Sub

        D 1 Reply Last reply
        0
        • M mghiassi

          I wrote this code and in .aspx.vb i write this code Protected Sub Page_Load(Parameters) GridView1.DataBind End Sub

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          What code? This is HTML. There's nothing here that calls any kind of database.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          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