DatagridView combined with DataSet
-
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.
-
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.
-
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")
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 ......
-
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 ......
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 -
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.
-
Fill method belongs to DataAdapter type, not DataSet. Probably your GridView is empty becouse your DataSet is empty. See DataAdapter documentation.
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.