Typed Dataset & DataViews?

R

Raterus

Hello, I'm experimenting with Typed DataSets, I need to be able to sort the data I'm holding in a particular DataTable, then iterate through these sorted results. My question revolves around what is the best way to use a strongly-typed DataView, if even possible. I know the DataView object isn't really meant for any particular DataTable, so I guess I'm a little confused as to how best access each row of data in the DataView. I'd hate to have to go all this way using a strongly-typed DataSet, only to eventually have to resort to myDataView.Item(0)("myFieldName"), much nicer would be myDataView.Item(0).myFieldName.

The reason I would like a typed DataView is that I'm trying to support a n-tier object model, and I can't just directly bind to the sorted DataView, I must iterate through items in the DataView first and then add them to my business object in the correct order.

Thanks for any help with this!
--Michael
 
R

Raterus

This did this trick:
http://groups.google.com/groups?selm=7ZId$F96BHA.2196@cpmsftngxa07&output=gplain

Basically the DataView.Item property has a Row property, which you can cast and get a strongly typed DataRow that you can use in the code.

--Michael

Hello, I'm experimenting with Typed DataSets, I need to be able to sort the data I'm holding in a particular DataTable, then iterate through these sorted results. My question revolves around what is the best way to use a strongly-typed DataView, if even possible. I know the DataView object isn't really meant for any particular DataTable, so I guess I'm a little confused as to how best access each row of data in the DataView. I'd hate to have to go all this way using a strongly-typed DataSet, only to eventually have to resort to myDataView.Item(0)("myFieldName"), much nicer would be myDataView.Item(0).myFieldName.

The reason I would like a typed DataView is that I'm trying to support a n-tier object model, and I can't just directly bind to the sorted DataView, I must iterate through items in the DataView first and then add them to my business object in the correct order.

Thanks for any help with this!
--Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top