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 rece开发者_如何转开发ived 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.
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.
you can access sql through php: http://www.silverlightshow.net/news/PHP-MySQL-and-Silverlight-The-Complete-Tutorial.aspx
精彩评论