Hi,
I am new to silverlight and need help in following regards.
I have created a class library in c# which uses System.data.sqlclient namesapce to connect to data and retrive results. I want to use this dll into my silverlight project. I tried to add this dll reference but it gives error saying the dll cannot be added as its not build against silverlight runtime.
I created a silverlight class library but it do not allow sqlclient namespace.
How to resoolve this?
Regards.
Dilip
Using C# class library in silverlight project
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ArshadRank #2,492 · 564 reputationPosted Aug 27, 2010, 9:45 AM EDT
You can not use the sqlclient directly in the silverlight application. its only for client purpose. for that you need to use web services to acces the data layer. even i am not much more knowledge about that. but i am very much sure that we can not directly use. sql n all.
you try to add the reference in Silverlight application, you will get to know. it does not show the .net assembly, it only shows the silverlight assembly.
Regards,
Arshad
Mahesh ChandRank #1 · 393.3K reputationPosted Aug 27, 2010, 9:53 AM EDT
Silverlight is a client-side API and SqlClient classes runs on server. The way you can access data in Silverlight applications are using LINQ or Web Services (or WCF).