Untitled document
you can use LINQ to query the Sharepoint lists
first you need to create LINQ->SQL classes for that you can use SQLMetal.exe tool
SPMetal.exe /web:http://localhost/ /code:C:\Projects.cs
public partial class ProjectsDataContext : Microsoft.SharePoint.Linq.DataContext {
#region Extensibility Method Definitions
partial void OnCreated();
#endregion
public ProjectsDataContext(string requestUrl) : this(requestUrl, true) {
}
public ProjectsDataContext(string requestUrl, Boolean tracking) : base(requestUrl)
{
this.OnCreated();
ObjectTrackingEnabled = tracking;
}
[Microsoft.SharePoint.Linq.ListAttribute(Name="departments")]
public Microsoft.SharePoint.Linq.EntityList<Item> Departments {
get {
return this.GetList<Item>("departments");
}
}