Add column data to gridview from dataset

cayongrayoo

Member
Joined
Feb 8, 2012
Messages
9
Programming Experience
Beginner
Hey.
I have a dataset with 16 tables in it. Most of the data i need is in one of those tables, So I've put all of that in a datagridview. However I need two columns that are in another table in the dataset. But only those two columns and all the data in those columns.
How do I put those two columns in the datagridview?
Do I create another dataset? another datagridview and move them across? if so how?
Thanks :D
 
yeah i think. the datagridview that i want to columns to be added to will have rows copied to another datagridview which it is alrdy doing.
 
Just realized I haven't been very clear about this. I want to add all the rows from a datatable but only the data in the two columns called lat and lon. Another way of putting it is add all the data from a datatable but only have the two columns displaying.
Tried using the datatable.merge class I get the error " object reference not set to an instance of an object"
 
Probably the best option for you would be to add an extra DataTable to your DataSet that already contains all the columns you need from the two tables and populate it with a query that performs the join. You'll then need to write the INSERT, UPDATE and DELETE statements yourself.
 
mm I see. As of yet I haven't used SQL in my program and i've done it all by just fiddling around with the datagridviews. I fear i may have hit a dead end and need to start using SQl...bugger.
 
Back
Top