1

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.

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

0

you can access sql through php: http://www.silverlightshow.net/news/PHP-MySQL-and-Silverlight-The-Complete-Tutorial.aspx

1 Comment

@Alem yay! (plz select the ans as correct then - check next the message)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.