views:

38

answers:

3

Hi, im trying to perform a simple database insert from a submission on a SilverLight Webpage. Normally i would either use ADO or LINQ to SQL to perform this. You can not do this within a SilverLight Project, nor can you reference a project that can (a non SilverLight project). What would be the best way of doing this?

Thanks.

+1  A: 

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

Jason Miesionczek
+2  A: 

For the most part, Silverlight apps are designed to talk to web-based data services or databases via RIA services.

There are a a few approaches to your problem:

  1. Reference a web service, like an .asmx or any REST servie
  2. Use WCF to communicate to the backend
  3. Use Silverlight RIA Services to talk to the database (it was designed to solve your problem)
Brian Genisio
A: 

Another alternative if you don't want to use web services, is to Xml Serialization and Isolated Storage to store the files. You'd simply load the database into memory on startup, and then persist to the file when the apps closes, or periodically.

Chris S