Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing SQL Server database from silverlight application

Our ASP.NET website allows user to perform a variety of queries and displays a network diagram (like a UML diagram) based on the result queried from database. At present, we are generating a Bitmap and displaying it. But since we needed to support a feature to allow user to show/hide certain blocks interactively, we plan to use Silverlight for rendering the graphic. Also we plan to add more interactions in the future.

I have two questions:

  1. Is it possible to an ASP.NET application to 'send' parameters to silverlight application.
  2. Is it possible for a silverlight application to query a SQL server database.

PS. If there are other better alternatives than Silverlight, please do suggest.

like image 744
softwarematter Avatar asked Feb 23 '23 11:02

softwarematter


1 Answers

You should use proper layered architecture in general and with SL you cannot, in fact, reference any class library which is not a SL control library.

Once you have your DAL and your BL layers available you can expose part of the logic of the BL as needed with a WCF service layer and use it from SL application. See my suggested layered approach here which works with any UI framework not only with MVC and applies also if you are not using EF in fact.

MVC3 and Entity Framework

like image 51
Davide Piras Avatar answered Feb 25 '23 02:02

Davide Piras