Filtered query - bindingsource
-
I'm trying to modify the filtered query example in the Noyes data binding book (ch 8) and have come up with a problem that I expect is reasonably standard: If a user filters outside of the data set, ie the data filter returns 0 rows from the binding source the column names populated in the combo box a cleared. The basic question then is how can I get the shape of a dataset, specifically column names from a dataset with no rows. This is an issue for performance in my case as in the first instance I need JUST the shape of the data set to which the binding source is bound. ie I don't want to retrieve the 100,000 rows in my table and then filter them, I need to apply the filter then refresh the dataset (think search engine). and I would prefer to do this from a control library. Any suggestion would be most welcome. Thanks, Paul
-
I'm trying to modify the filtered query example in the Noyes data binding book (ch 8) and have come up with a problem that I expect is reasonably standard: If a user filters outside of the data set, ie the data filter returns 0 rows from the binding source the column names populated in the combo box a cleared. The basic question then is how can I get the shape of a dataset, specifically column names from a dataset with no rows. This is an issue for performance in my case as in the first instance I need JUST the shape of the data set to which the binding source is bound. ie I don't want to retrieve the 100,000 rows in my table and then filter them, I need to apply the filter then refresh the dataset (think search engine). and I would prefer to do this from a control library. Any suggestion would be most welcome. Thanks, Paul
Hi Paul Use "FillSchema" method to get only data structure and call "Fill" method when you need to get data. eg. yyy.FillSchema(dt, ....mapped) xxx.DataSource=dt