Sunday, 30 October 2011

Step by step building a Silverlight Business Application

I will present a stright forward step by step tutorial to build a complete Silverlight Business Application and how to merge the Membership provider database with our application database.

  1. Create your SQL Server db (example: dbExample).
  2. Run aspnet_regsql.exe found in: (C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe)
  3. Choose your SQL Server instance and your database (dbExample) and go.
  4. Check new tables add to your database (dbExample) by asnet_regsql.
  5. Run MSVS2010 > New Project > Silverlight Business Application.
  6. Add to Web Applicataiono ADO.net EDM.
  7. Connect to your database (dbExample).
  8. Choose your tables.
  9. Open file Web.Config in Web Application
  10. Copy ConnectionString for your database (dbExample) for the EDM and paste it in the ConnectionString named ApplicationService.
  11. Choose Web Application and Run ASP.NET Confiugration
  12. Test connection
  13. Add Roles (example: Admin).
  14. Add User (example: viewUser).
  15. Add User (example: AdminUser) member of Admin Role.
  16. Add DomainService to Web Application, choose your tables, name it (exampleDomainService).
  17. In your DomainService (exampleDomainService) before each IQuerable query add the following:
  18.  nothing    query can be accessed by any user.
  19.  [RequiresAuthentication]  query can be accessed by logged in users only.
  20.  [RequiresRole("Admin")]  query can be accessed by logged in users and member of Role: (Admin).
  21. In Client Application in (Views) folder add (Silverlight Page), name it examplePage.xaml.

No comments:

Post a Comment