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. DatagridView combined with DataSet

DatagridView combined with DataSet

Scheduled Pinned Locked Moved Visual Basic
helpquestion
6 Posts 4 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
    jan_le
    wrote on last edited by
    #1

    Hi, I tried do use an typed DataSet (with 2 Tables, 1 Master-detail-Relation), and wrote: DataGridView1.DataSource = DataSet1 the Gridview shows the columns well, but null data, null rows. A Method like DataSet1.Fill I missing, you can me help, how the Data load in the DataSet? Many thanks, Jan.

    S _ 2 Replies Last reply
    0
    • J jan_le

      Hi, I tried do use an typed DataSet (with 2 Tables, 1 Master-detail-Relation), and wrote: DataGridView1.DataSource = DataSet1 the Gridview shows the columns well, but null data, null rows. A Method like DataSet1.Fill I missing, you can me help, how the Data load in the DataSet? Many thanks, Jan.

      S Offline
      S Offline
      Scubapro
      wrote on last edited by
      #2

      Since your DataSet1 contains 2 Tables, you'll have to set the table you'll want to show. So use:

      DataGridView1.DataSource = DataSet1.Tables("TableName")

      J 1 Reply Last reply
      0
      • S Scubapro

        Since your DataSet1 contains 2 Tables, you'll have to set the table you'll want to show. So use:

        DataGridView1.DataSource = DataSet1.Tables("TableName")

        J Offline
        J Offline
        jan_le
        wrote on last edited by
        #3

        it dosn´t work. may be, the relation between master and detail not is correct? Im using mysqlconnector 5.1 and made the dataset in vs2008-datenquellen. the datas are in the dataset - with xml i can all export. but in the grid nothing to see..... please help ......

        D 1 Reply Last reply
        0
        • J jan_le

          it dosn´t work. may be, the relation between master and detail not is correct? Im using mysqlconnector 5.1 and made the dataset in vs2008-datenquellen. the datas are in the dataset - with xml i can all export. but in the grid nothing to see..... please help ......

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

          What do you mean by "It doesn't work"?? What DOES happen? What does the code look like that you're using to set the datasource? You can use an index number in the DataSet.Tables(index), instead of a string. Have you tried that??

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          1 Reply Last reply
          0
          • J jan_le

            Hi, I tried do use an typed DataSet (with 2 Tables, 1 Master-detail-Relation), and wrote: DataGridView1.DataSource = DataSet1 the Gridview shows the columns well, but null data, null rows. A Method like DataSet1.Fill I missing, you can me help, how the Data load in the DataSet? Many thanks, Jan.

            _ Offline
            _ Offline
            _Erik_
            wrote on last edited by
            #5

            Fill method belongs to DataAdapter type, not DataSet. Probably your GridView is empty becouse your DataSet is empty. See DataAdapter documentation.

            J 1 Reply Last reply
            0
            • _ _Erik_

              Fill method belongs to DataAdapter type, not DataSet. Probably your GridView is empty becouse your DataSet is empty. See DataAdapter documentation.

              J Offline
              J Offline
              jan_le
              wrote on last edited by
              #6

              Hi Erik, it is me clearly. DataAdapter has filled the tables in the dataset, i Can export to xml. More then 2000 rows. DataGridView shows the data still does not, data source and data member are set, the DataSource= DataSet1, DataMember = tableName. Does it need more settings so the GridView works and shows the data? It shows the ColumnNames, but ZERO Data. Thanks for help.

              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