Click here to Skip to main content
15,065,783 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to add multiple Tables into a single DataGridView? I have four different tables and I want to display it in a single gridview. So How can I? please help me
Posted
Comments
vinay.tatipamula 26-Aug-13 7:02am
   
You mean it is System.Data.DataTable?

U r Question is nt clear wat do u mean by multiple table, r u getting vales from different table?
and u wan to show in the on data grid view how many columns u gave in datagried view?
   
Comments
Aboobakkar Siddeq D U 26-Aug-13 7:06am
   
Yeah I have 4 different tables, each tables contains one columns and I didn't add any column to gridview, I want to bind it directly from tables. How can I?
kiran murkal 26-Aug-13 7:12am
   
Select all columns from different table and store in data set and bind with grid i hope its work
You can use DataSet to store four tables..and you can assign DataSet to Gridview.datasource
   
Comments
Aboobakkar Siddeq D U 26-Aug-13 7:07am
   
I tried this

DataSet ds = new DataSet();
ds.Tables.Add(ds1.Tables[0]);
ds.Tables.Add(ds2.Tables[0]);
ds.Tables.Add(ds3.Tables[0]);
ds.Tables.Add(ds4.Tables[0]);

but i'm getting error like this "DataTable already belongs to another DataSet."
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900