hi, I was trying to bind a dataset to a listbox..certainly because i want to display a couple of tables information in a datatemplate..But this seems not possible and i will have to convert it to an observable collection.But how can i do it.My bl returns dataset objects.How can i convert this to observablecollection..? Is there any way so that i can handle this situation in MVVM..? How do people handle datasets in MVVM architecture..?
A DataSet is a .Net representation of a set of tables, and the relationahips between them. It is kind of like an in-memory code-accessible representation of a mini-database. Only a few controls can bimd directly to a dataset - those that are coded to analyze the relationships between the datasets tables and represent the various tables' data in some kind of hiearchical display, (like a treeview or a hiearchical grid) Anything that requires a simple list of items, with one or two properties for each item can not be bound directly to a dataste, it can only be bound to one of the contained datatables.
Alternatively, you need to dynamically construct and populate a datatable of your own, constructed from the various tables in the dataset you are using, to properly service the specific control you want to bind it to.