views:

609

answers:

2

I have a silverlight application which reads data from a db and displays them in a grid. As far as i understand it there are two ways to do it. 1) Read db with a server-side language, such as php, create a file in the server which you can later use in Silverlight to read the data. 2) Connect "directly" using Silverlight code with your db and do your job there. I have read some posts that explain more or less how this is possible, but i haven't found a working example.

I really need to go towards the 2nd approach. Can anyone provide a simple example on how to connect and query to your mysql db safely from Silverlight?

Thank you.

A: 

Silverlight runs on the client side in the browser, there is no way to directly hit a database. The way to get data is to hit a webservice, you could use ADO Data Services but they only run Sql Server in their cloud.

CSharpAtl
A: 

You could use the MySQL connector for Entity Framework and then connect to the database using .NET RIA Services.

Whatever route you go you're going to need to create some method to read data from the database on the server and return that to Silverlight as objects.

Bryant
house-keeping; the OP left a comment-as-an-answer (now deleted): "bryant, is there a sample somewhere on this?"
Marc Gravell
It's working smoothly. thanks
immuner