Hello,
Most things I do have relatively small datasets, now I wish to load a large dataset and let the user do the filtering using the grids built in filters and such having all the records available to the grid.
I know there are features like lazy loading and such, but I work like this
Create ODBCConnection,DataAdapterthen fill dataset / datatable using dataadapterfinally setting the datacontext to the filled table.I was wondering if there was a way to connect the datagrid to the dataadapter, or some other way to prevent having to load and then hold the entire dataset / datatable in memory?
Any help appreciated.
- Anthony
Hello Anthony,
I was not able to understand your requirement completely. The DataAdapter is used to fill a DataSet and transfer the data from the database. Do you mean that you want to fill the XamDataGrid with a DataAdapter directly? Probably something like this.
Bottomline, the XamDataGrid's DataSource accepts everything that is IEnumerable. It also has DataItems collection but the data would still be in the memory.
What I was trying to do was avoid having to read all 50 million records from the database into the client PC in a dataset,
So when you start the app, xamdatagrid pulls the records directly from the sql server, maybe fetching enough to fill the display (lazy loading), loading more records if the user scrolls, or applys a filter etc.
I checked out the link, are you saying I can create a datareader, and then connect it to a xamdatagrid, and have it pull the records from the DB as it requires them? As I understood it, datareader is not IEnumerable.