Storing Data on the SilverLight Web Page

im trying to do a simple database insert from a view on a SilverLight web page. Usually I would use ADO or LINQ to SQL to accomplish this. You cannot do this in a SilverLight project, nor can you reference a project that can (a non-SilverLight project). What would be the best way to do this?

Thanks.

+2


a source to share


3 answers


For the most part, Silverlight applications are designed to communicate with web data or database services through RIA services.

There are several approaches to your problem:



  • Link to a web service like .asmx or any REST service
  • Use WCF to communicate with the backend
  • Use Silverlight RIA Services to work with the database (it was designed to solve your problem).
+2


a source


Your best bet is to use .NET RIA services, which will allow you to define server side domain classes and because of the RIA Services reference, will generate client side code in your silverlight project.



+1


a source


Another alternative if you don't want to use web services is Xml Serialization and Isolated File Storage. You just load the database into memory at startup and then save the file when applications close or intermittently.

0


a source







All Articles