Step to Create the Application
1) Create a Silver Light Application (web).
2) Add WCF service template or Silver Light-enabled WCF service template to Silver Light Application Testing project.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgndAN84R1cTXWIIgGJb7woFi-81P2HXLh17onky9V0KC_2VRt1ot_e4BKYPj31iAy3YW30jyg73uvqWtOmjY9HdQCAAYodoeg2ok6HRl8iuuJVUBbsS1EWUsHGonIO4bgKZKtfz-5NbpTL/s400/SreeniBlog.jpg)
3) Add OperationContract called GetCustomers in Service.cs.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace DBPagenation.Web
{
// NOTE: If you change the interface name "ISreeniDataService" here, you must also update the reference to "ISreeniDataService" in Web.config.
[ServiceContract]
public interface ISreeniDataService
{
[OperationContract]
ListGetCustomers(int pageNumber);
}
}
4) Add LINQ to SQL Classes and create a data class by dragging Customers table from server Explorer. And change the serialization mode properties to Unidirectional. This properties make data class as realizable [DataContract].
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUHQdraBdCGdgwlBqzPWQwPzwSa_5KjNloC8W09F-VAU9bDIm13o2vV4_chvJ6owlWW7yPD9F9C45Vs2R-AYeCWDV5JZWk8Ay8WxXMB0_07TVB2unlY-Jt9akLaLzwa8pNIc-zq01q5tfe/s400/Blog2.jpg)
Silver Light UI CODE:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoV3mZjswI3wQ8xU7mBYIhl2VVP8ffUeyr8twK4OR9WFwuWa52k5wd94DkWH3-aii-wZiBMovbqexrdiAsG80vFW-OQ_i3pD_aw5DPMhPbAE6NP4_Ckd43a4TtvnsMdqKmImsjUFO9UNO0/s400/Record.jpg)
using Slider control now navigate different pages of customer records instead of clicking old style like 1 2 3 4 5...
Thanks
SeenivasaRagavan
No comments:
Post a Comment