Mika
Mika

Reputation: 111

Accessing A MySQL Database In Silverlight (C#)

I am trying to access a MySQL database in a Silverlight application. I have tried to reference to System.Data.Services to access the SQLClient class, but it says:

You can't add a reference to System.Data.Services.dll as it was not built against the Silverlight runtime. Silverlight projects will only work with Silverlight assemblies.

I have also tried to add a reference to MySQL.Data, but received the same error.

I have read online that I will need to use a WebService, but I do not know how to make one.

I am using Visual Studio Ultimate 2010, I am targeting PHP and MySQL servers, not ASP, and would appreciate any help.

Upvotes: 1

Views: 3259

Answers (2)

Adi
Adi

Reputation: 5223

Alem, Silverlight is a client-side technology.

It will only work in browsers. You cannot just make direct call to a database from your Silverlight app.

First off, this would be a major security issue you don't want to deal so fortunately you are not even allowed to.

Use webservices, or even better: WCF services. Try this link: http://chakkaradeep.wordpress.com/2008/05/31/silverlight-and-wcf/

Hope this helps.

Upvotes: 3

Related Questions