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. DataGrid In ASP.NET Page?

DataGrid In ASP.NET Page?

Scheduled Pinned Locked Moved ASP.NET
databasecsharpasp-netsql-server
4 Posts 3 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.
  • G Offline
    G Offline
    GrindAZ
    wrote on last edited by
    #1

    I am new to using ASP.NET although I have written several applications in VB.NET. I am trying to dispaly data from a database in a datagrid. I fill a dataset with data using a stored procedure from a SQL server database. I then set the datasource property of the datagrid equal to the dataset. The problem is the datagrid is never displayed on my page. the weird thing is the rowcount of the datagrid is correct. Any ideas?

    N N 2 Replies Last reply
    0
    • G GrindAZ

      I am new to using ASP.NET although I have written several applications in VB.NET. I am trying to dispaly data from a database in a datagrid. I fill a dataset with data using a stored procedure from a SQL server database. I then set the datasource property of the datagrid equal to the dataset. The problem is the datagrid is never displayed on my page. the weird thing is the rowcount of the datagrid is correct. Any ideas?

      N Offline
      N Offline
      Nick Seng
      wrote on last edited by
      #2

      Hmmmm.....some thoughts: 1. How did you add the datagrid to the webform? 2. Did you databind the grid? 3. When did you databind the grid? Nick Seng (the programmer formerly known as Notorious SMC)


      God, I pity me! - Phoncible P. Bone

      G 1 Reply Last reply
      0
      • N Nick Seng

        Hmmmm.....some thoughts: 1. How did you add the datagrid to the webform? 2. Did you databind the grid? 3. When did you databind the grid? Nick Seng (the programmer formerly known as Notorious SMC)


        God, I pity me! - Phoncible P. Bone

        G Offline
        G Offline
        GrindAZ
        wrote on last edited by
        #3

        Yeah I didn't databind the grid. Thanks for the help.

        1 Reply Last reply
        0
        • G GrindAZ

          I am new to using ASP.NET although I have written several applications in VB.NET. I am trying to dispaly data from a database in a datagrid. I fill a dataset with data using a stored procedure from a SQL server database. I then set the datasource property of the datagrid equal to the dataset. The problem is the datagrid is never displayed on my page. the weird thing is the rowcount of the datagrid is correct. Any ideas?

          N Offline
          N Offline
          Nick Pirocanac
          wrote on last edited by
          #4

          Hi, Have you ensured that you call DataBind() on your data grid after you set the data source? DataGrid dgMyDataGrid = new DataGrid(); DataSet dsMyData = new DataSet(); ... Setup your dataset ... dgMyDataGrid.DataSource = dsMyData.Tables[0]; **dgMyDataGrid.DataBind();** Give that a shot! Nick. Nick.

          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