Language Integrated Query, LINQ, is a .NET Framework component used for native data querying

learn more… | top users | synonyms

8
votes
2answers
1k views

LINQ to Sharepoint - Repository pattern and common methods in repositories

I generated a entity classes + data contexts by LINQ to Sharepoint and created a repository classes. When I use normal database and mapping like Entity framework I've got usually some base repository ...
6
votes
3answers
799 views

sharepoint caml is fast - how?

We all know that Caml is faster than using linq, since linq internally gets translated to caml. But can anyone explain how caml is best to do sharepoint queries or how it is fast or what makes it ...
6
votes
2answers
4k views

Get all Files from sub folder of a certain content type

my problem is I have a document library with sub folders. Also the document library got more than one content type. Is there a way to create a CAML or LINQ query to get all files of a certain content ...
5
votes
2answers
501 views

Get CAML from LINQ to SharePoint

Is there an equilivant to GetCommand in LINQ to SharePoint? I know about ctx.Log, but I'm looking for something to retrieve the CAML from a LINQ statement without executing it.
5
votes
1answer
383 views

SPMetal and automated build approch

When using SPMetal to generate entity classes, these classes are used in LINQ to SharePoint queries. We have a project with content type and list definitions and one project with business logic which ...
5
votes
1answer
371 views

Get SPListItem from LINQ

I have used SPMetal to create a data context. I can query my lists. The queries return an object of the type of list that they are in. Is it possible to convert this type into a normal SPListItem ...
4
votes
4answers
4k views

CAML vs LINQ vs SQL

So LINQ is a front end to CAML so of course CAML is faster, and CAML is a front end to SQL so of course SQL is faster. However what would be a good test to see where and when to use each of these on ...
4
votes
1answer
578 views

Visual web part - data binder issues

We have couple of lists in our application. Application types is a list which contains information about various applications - name, description and icon (as URL field with image format). Second one ...
3
votes
3answers
6k views

Using LINQ to select SPListItems and load a SPGridView

Is there a way to run this LINQ statement var items = from SPListItem li in listSettings.Items where li["WebID"].ToString() == SPContext.Current.Web.ID.ToString() orderby ...
3
votes
2answers
3k views

Value does not fall within the expected range. LINQ

I have a very strange situation, exactly same site and code on server and developer machine. On server everything works fine, but on developer I encounter such a problem (details below). It happens if ...
3
votes
2answers
144 views

Sharepoint 2013 Dispose in linq

I'm wondering if this needs to be disposed or if it's a bad method to get the title of a web. var currentWebApp = SPContext.Current.Site.WebApplication; IEnumerable<SPSite> allTeamSites = ...
3
votes
2answers
1k views

Frustrated! Linq to SharePoint, choice values, losing spaces

I'm using Linq to grab my SharePoint data (used CKS tools to create the class). I've been having some headaches with using it especially around choice fields. All of the choice values are converted ...
3
votes
1answer
272 views

SPMetal parameter file and oob fields like created, modified, etc. not created

I'm using CKSDev spmetal generator. I have set up the following parameter file : <Web xmlns="http://schemas.microsoft.com/SharePoint/2009/spmetal" Class="ModelContext"> <ContentType ...
3
votes
1answer
793 views

Dynamic LINQ to SharePoint and Projection

How to build dynamic LINQ to SharePoint expression like this(but store "Bill", "Sam" in array): // listing 1 // SPEntityModelDataContext generated with SPMetal using (var db = new ...
2
votes
2answers
941 views

How to find a file with name = X in a SPList

Looking for recommendations. Have a file in a document library with name x.txt. In a workflow code behind, I need to get the file to read its contents. What is the best/most efficient way to do ...
2
votes
4answers
558 views

why doesn't SPMetal generate Publishing Schedule columns?

Happy 2011 experts, I have a sharepoint 2010 publishing site that I use SPMetal to generate classes to. The problem is some fields do not get generated like: PublishingStartDate and ...
2
votes
5answers
3k views

Quick and effective way to do an inner join using LINQ to Sharepoint on 2 tables

I can't seem to find a guide which explains how to do an inner join on lookup fields using LINQ. Most of the guides require converting the EntityLists to custom objects so you can join on non lookup ...
2
votes
2answers
669 views

Editing web.config file from a feature using linq

I have custom web.config functionality that uses Linq to merge elements into a web.config based on a template file. I would like to use this in a feature so I can get it to merge all web.configs in a ...
2
votes
2answers
207 views

Linq to SharePoint and localization

I'm working on a project which has localized site definitions. Now for one part, I wanted to use spmetal to generate a datacontext. Works, but I noticed the generated class retrieves lists by their ...
2
votes
1answer
437 views

merge two lists with WCF Services and Linq

How do I merge two lists when using REST services? You can't use union with linq and dataservicequery so I'm not sure where to go. The following doesn't work with dataservicequery... var docQuery = ...
2
votes
3answers
2k views

Getting “Access denied” error message when trying to access a SharePoint list via Linq from an Web Service

I have following scenario. A web service hosted on IIS 7 should take messages from a MSMQ, transform them and put them into a custom SharePoint list. The list, contenttype and columns were defined ...
2
votes
0answers
477 views

Reverse lookup with Linq to SharePoint

I have two lists called ‘Events’ (custom list) and ‘Timeslots’ (calendar list), Timeslots has a lookup in to the id column of Events. Each event can have multiple timeslots. I need to show columns ...
2
votes
0answers
213 views

Resource throttling and LINQ / spmetal

Today I received an e-mail from a customer telling me their site broke. I checked the ULS and noticed resource throttling had kicked in on one of the sites. I'm used to this when using ...
1
vote
1answer
712 views

Using SPMetal to read data from sharepoint 2010

I've just started to look at using spmetal with SP 2010 to read data from document libraries: http://msdn.microsoft.com/en-us/library/ee538255.aspx I'm curious as to how I can ensure that I only ...
1
vote
1answer
81 views

Will searching SPWebApplication.Sites with Linq need to be diposed?

Situation: I only have the full URL of an image in our farm & no knowledge of where it comes from other than being in the web application so I need to locate the site/web/list/item segments. ...
1
vote
2answers
348 views

Exists / Count in client object model

What's a good way to perform an Exists or Count on the client object model classes? I have list with views. I want to check if a view already exists before creating it. Tried a couple of things, but ...
1
vote
1answer
138 views

What is the best way to access sharepoint lists?

In the past I tried with linq using spmetal, but after the project was almost finished I realized of some limitations, this tool does not generate fields for creation date, modified date, also it ...
1
vote
1answer
141 views

How to get all webs in Farm or WebApplication with one Linq to SharePoint query?

Is it possible to get all webs in Farm or WebApplication with one Linq to SharePoint query? Now my data context constructor takes only takes one argument, and that is one web. This way I need to loop ...
1
vote
1answer
549 views

Is it possible in LINQ to SharePoint

I have a task to make a WSP, which should provide definitions of custom list and library, but not instances. List definition has a lookup column to library item <Field ...
1
vote
1answer
1k views

How to get results from listdata.svc from a certain folder

I'm looking to get a certain set of data from my list using the listdata.svc service with AJAX. The problem is inside the list I have folders, and I'd like to only receive elements inside a certain ...
1
vote
1answer
181 views

LINQ Query to obtain only the list names

How can I get only the lists present in a particular site? I've tried the following one: var listNames = from SPList list in web.Lists where list.BaseTemplate != ...
1
vote
2answers
945 views

LINQ to SharePoint and localized list names

I'm trying to use Linq to SharePoint to save a new record in my list. I provided my own List definition for which I have 2 resource files that are giving the good list names (French and English). ...
1
vote
1answer
1k views

Sharepoint 2010: Full text plus faceted search over an External Content List using Search Services (or possibly FAST)

I have an External List over a products table in our database. I want to be able to build a search form over it via a full text search; in addition to being able to filter down on properties on my ...
1
vote
1answer
1k views

how to linq query spfield to spuser

Here is my code. SPUser approver = mySite.EnsureUser(approverId); var selectedItems = listItems.Cast<SPListItem>().Where(p => p.Fields["WF_Approver"] == approver); my list items field ...
1
vote
0answers
92 views

LINQ DataSource DataContext: Could not load type

I made a very simple webpart with a grid view and and a LINQ to SQL data context object to surface some employee information for a phone list. I was able to databind the grid view directly to LINQ ...
1
vote
1answer
113 views

Linq to sharepoint: Cannot find corresponding storage member

I'm trying to use Linq to Sharepoint to get a list and i got this message: Cannot find corresponding storage member for member Title I've tried some solution but nothing worked. And i don't ...
1
vote
0answers
22 views

LINQ to SP Problem

I have a following var resultsMarks = from mItem in MItemList.ToList() select new { ScienceGroup = mItem.ScienceGroup, ArtsGroup = mItem.ArtsGroup, CommerceGroup = mItem.CommerceGroup, ...
1
vote
0answers
177 views

Linq to Sharepoint throws System.IndexOutOfRangeException

I have used entity class generated from SPMetal to retrieve data from sharepoint list. Frequently I am getting the below error on the sharepoint page and not able to do anything in the site. This ...
1
vote
0answers
54 views

LINQPad cannot connect to remote Sharepoint machine

I have been working with the SP2010 OData interface to get some quick and dirty sheets as required by colleagues. Now I need to use some additional methods (f.e.:GroubBy) and therefore need to use ...
1
vote
1answer
170 views

SharePoint, LINQ & Reporting Services Tools

I'm new to SP and SSRS, so I want to check if my thoughts are correct. Report Builder and BIDS suck on data retrieval so I have to go deeper using code. Is it possible to write some code in C# using ...
1
vote
0answers
37 views

Linq query multiple master tables

I have a question related to LINQ queries in SharePoint 2010. I have few master lists - 1> Team (ID, Name) 2> Lifecycle (ID, Name) 3> Technology (ID, Name) 4> Users (ID, Name) Then there is a mapping ...
1
vote
1answer
266 views

My List Content Type is no being found by SPMetal

I am trying to use Linq to Sharepoint for some custom reports but I am running into an issue trying to setup SPMetal. I generated the class but for one of my lists "ListA" only ID and Title fields ...
1
vote
0answers
60 views

Is there a visual building tool to generate LINQ Queries? [closed]

Is there a visual building tool to generate LINQ Queries (from sharepoint lists) similar to CAML's U2U builder or CAML Designer? Thanks
1
vote
1answer
868 views

Lookup field Join not working

I am new to sharepoint and i am using Linq to Sharepoint in my project. I have two Lists in TestSite. Details are as below Department DepartmentName Single line of text ManagerId Person or ...
1
vote
0answers
1k views

An item with the same key has already been added when trying to recover my list using Linq (SPMetal)

I have a problem with my application SharePoint. The problem is that I added a List in my SharePoint site (directly in SharePoint), then I used SPMetal LINQ to generate a File in which I can recover ...
1
vote
0answers
171 views

Generating Entity List property for “Reusable Content” list

I am attempting to generate an entity class for "Reusable Content" list. After running the CKSDEV tool, i see that DataContext object has the following /// <summary> /// Items in this list ...
1
vote
1answer
390 views

System.Data.Linq the given assembly name or code base was invalid

I have a webservice in my sharepoint site which uses System.Data.Linq to add some data to the database. If I make a call to this webservice, I get the following error: The given assembly name or ...
1
vote
2answers
573 views

Can I use LINQ to lists in sharepoint online?

Can I use LINQ with lists in sharepoint online? If so, can someone provide me with an example?
1
vote
0answers
242 views

Getting at InfoPath/form library data using LINQ to SharePoint

I'm teaching myself some basic SharePoint stuff, coming from three-tier ASP.NET, and before that, Java background. I've been trying to figure out how to do things "the SharePoint" way, rather than ...
1
vote
0answers
1k views

Inserting new item in list with EntityRef field to User Information List using Linq to SharePoint

I have a list with SPFieldUser field type in it. I try to insert new item in this list using Linq 2 SP. So, I generated data context class using the following configuration file: <List Name="User ...