?
Solved

how to convert observable collection to dataTable

Posted on 2011-09-21
3
Medium Priority
?
4,124 Views
Last Modified: 2013-11-12
I want to convert my updated/changed observable collection to datatable to save back into the database. I only want to save the newly updated values in the collection.
Please help, I am using MVVM pattern.
0
Comment
Question by:Masterabhi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
theHollow earned 1500 total points
ID: 36579140
Hello
There are many ways of managing this. But I believe that MVVM does not have anything to do with this. This is (in my opinion) something that will be coded the same in WPF (with or without the MVVM pattern) and Windows.Forms.

You could build your own layer and convert from custom classes to your database tables.
Or you could build your own generic layer/provider that does this automatically.
That is called an ORM (Object Relation Model).

Or you can concider using solutions that are already made.

I found this article about the "NHibernate" ORM:
http://www.developer.com/net/asp/article.php/3709346/Using-NHibernate-as-an-ORM-Solution-for-NET.htm

You can check it out. I hope it helps you a bit :-)
0
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 36597357
Data tables not been included in Silverlight , so as to keep it light. The ideal way to handle is as theHollow had said use and ORM like EF4, which can generate objects which can be directly consumed in SL.

Putting custom code in to simulate a data table would be really costly. If there is no other option but to have data table one method would be to generate an xml of the data table and send it to the service and then deserialzie there and get the data table.
0
 

Author Closing Comment

by:Masterabhi
ID: 36958992
Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question