free web page counters
Welcome to MSDN Blogs Sign in | Join | Help

LINQ to SharePoint

Bart De Smet has continued his work on the LINQ to SharePoint project. From the website:

The LINQ to SharePoint project provides a custom query provider for LINQ that allows to query SharePoint lists using familiar LINQ syntax. LINQ stands for Language Integrated Query and is one of the core features of Microsoft's .NET Framework 3.5 release.

Some of its current features include a custom query provider that translates LINQ queries into CAML (Collaborative Application Markup Language) which is used by SharePoint for querying, support for both C# 3.0 and Visual Basic 9.0 and can connect to SharePoint using the object model or via the web services interface.

Related links:

Published Wednesday, July 18, 2007 4:44 PM by tommer

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: LINQ to SharePoint

Wednesday, July 18, 2007 1:10 PM by Bart De Smet

Hi Tom,

Thanks for linking to the LINQ to SharePoint project. I'm happy to announce an interim release is coming up later this week, which will cover a first set of VS 2008 IDE integration.

Cheers,

-Bart

# re: LINQ to SharePoint

Friday, May 29, 2009 5:51 PM by Wagner Amorim

Hello My friend!

I have "LINQ To SharePoint v0.2.4.0" (http://linqtosharepoint.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=8713) with VS 2008 and WSS 3.0.

I cant use function JOIN in my queries, why?

Example:

private System.Net.NetworkCredential CredenciaisU = new System.Net.NetworkCredential("hcdadmin", "#cd@dm!n09");

public DataSet GetSituacaoCadastral(String VRegional, String VDistri, String VFunc) {

OSharePointDataContext dsSC = new OSharePointDataContext();

dsSC.Credentials = CredenciaisU;

DataSet ds = new DataSet();

var OUsuarios = dsSC.Usuarios;

var ODistribuidores = dsSC.Distribuidores;

var querySC = from u in OUsers //from d in ODistribuidores

//where u.Cargo == Funcao && u.Distribuidor == Distribuidor// && u.Distribuidor == d.Distribuidor

join d in ODistri on u.Distri equals d.Distri

where u.Cargo == VFunc && d.Distri == VDistri && d.Regional == VRegional

select new {Name = u.FullName, Distri = u.Distri};

DataTable dtSC = new DataTable("SituationC");

//

dtSC.Columns.Add("FullName");

dtSC.Columns.Add("Distri");

//

DataRow row;

foreach (var nSC in querySC) {

//

row = dtSC.NewRow();

row["FullName"] = nSC.Name;

row["Distri"] = nSC.Distri;

dtSC.Rows.Add();

}

ds.Tables.Add(dtSC);

return ds;

}

Thanks!!!

Wagner Amorim

wa.amorim@hotmail.com

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker