views:

193

answers:

2

Hi everyone,

I know we cannot access directly to a database with Silverlight. Linq 2 SQL doesn't exist for Silverlight but can I use other things ? I heard too about RIA Services and ADO.net but I don't think they are implemented for a Linux Server.

Thanks for your future answers.

+1  A: 

If you can create a REST or SOAP web service that exposes data from the database, then Silverlight can access that service with its networking stack.

Michael S. Scherotter
But the problem is to generate the model of Database on Linux. I will not modify my model every time the database is modifiying.
You should build an app model on your server that insulates database changes from the interface layer in Silverlight with its service interface. Why don't you try an IIS server instead of Linux - RIA Services automates much of that process?
Michael S. Scherotter
A: 

You will need to put a few things together.

First if you want to create a Model then you will be looking for an ORM that works itn Postgresql there a probably a few, I stubbled on Storm but there are probably others.

You will then need to expose the model using SOAP again there are a few implementations of SOAP you could use. (In fact at this point I'm going to tweak your tags to target this question better, this not a Linq-To-SQL, c#, or ado.net question).

AnthonyWJones
Are there any ORM framework that mono support ?
@user301089: See http://stackoverflow.com/questions/289583/best-object-relation-mapping-framework-to-use-with-net-and-mono
AnthonyWJones
I've read example of NHibernate. The problem is the same whent I modify the database I need to change the class implementing NHibernate.I've seen that ADO.NET 2.0 is supported by Mono but I can't find any example of that.
@user301089: Whether ADO.NET 2.0 is support isn't the issue, your problem is creating a client-side Model that you can interact with in Silverlight that connects to the server. There isn't an existing end-to-end solution for this. You need to build it yourself, the glue is probably SOAP. If you can expose any classes defined by an ORM with SOAP you have a fighting chance of creating client-side SOAP end-point that you can consume in Sliverlight. It isn't going to smooth.
AnthonyWJones
I don't understand why is the Model is in the client-side ? I thought it will be on the server side near the database. Won't be better that the model is on the server side ?
@user301089: The content of your question leads to that assumption, you can leave the model only on the server or simple not have model or an ORM at all. There are a million ways to skin to this cat. You could use WebClient to fetch some XML or JSON from a PHP page that queries your PostgreSQL if you like.
AnthonyWJones
The solution that I have for the moment is to use webservice with ASP.Net. In the server side I use the data provider NPGSQL to access database but I have written by hand the classes of the model and I put into this class the result of my sql query. I just need a solution to replace my classes written by hand with a substract layer so I tought about ADO.NET or LINQ TO SQL