Solved

how to convert observable collection to dataTable

Posted on 2011-09-21
3
3,893 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
3 Comments
 
LVL 4

Accepted Solution

by:
theHollow earned 500 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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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