jamie_pattison
Well-known member
- Joined
- Sep 9, 2008
- Messages
- 116
- Programming Experience
- Beginner
Im not sure if this is possible or if i dont understand something here. I have a Dataset with two SQL queries. One query calls "all" the data and second calls "half" the data (in simple terms).
I add a DataGridView to my windows form.. I am now trying to connect the DataGridView to the QUERY that displays half the data - this works as expected when i programmatically do this ,however i dont have the option to add and delete columns, rename them etc etc and it also displays column names for those that i excluded in the SQL query (but no data).
So reading around it seems that i have to use a BindingSource to call the query at design time. Once i do this then i should have the usual options to edit the column names etc etc as required for the DataGridView once i use the BindingSource as the source for the DGV.
Question is how do i do this as so far all the attempts ive tried bring back all the data and dont allow me to select any SQL queries from my dataset. I believe i could set the filter on the BindingSource but that defeats the point of having a Dataset with a query that i would like to run. Programmatically it works but then i have some unusual results?
Thanks
I add a DataGridView to my windows form.. I am now trying to connect the DataGridView to the QUERY that displays half the data - this works as expected when i programmatically do this ,however i dont have the option to add and delete columns, rename them etc etc and it also displays column names for those that i excluded in the SQL query (but no data).
So reading around it seems that i have to use a BindingSource to call the query at design time. Once i do this then i should have the usual options to edit the column names etc etc as required for the DataGridView once i use the BindingSource as the source for the DGV.
Question is how do i do this as so far all the attempts ive tried bring back all the data and dont allow me to select any SQL queries from my dataset. I believe i could set the filter on the BindingSource but that defeats the point of having a Dataset with a query that i would like to run. Programmatically it works but then i have some unusual results?
Thanks