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

learn more… | top users | synonyms

1
vote
2answers
50 views

Filter list with Linq and lookupvalue

I've a list with a lookup column named Agents. I want to filter it by using the Lookup Value in "Agents" with Linq but I don't understand how to be able to compare the lookup Value to a string. the ...
0
votes
1answer
24 views

Use LINQ GroupBy with SPListItemsCollection

I have a SharePoint list containing some items. I would like to apply grouping to the items using LINQ, preferably with .GroupBy method. This is the list of fields that the list item is consisted of: ...
0
votes
1answer
28 views

SharePoint Linq ToList ArgoumentException

I'm using SharePoint 2010 Foundation with LINQ for SharePoint list. I've generate my DataContext using spmetal command. Now I'm trying to access data but I have this error: ArgoumentException ...
-1
votes
1answer
750 views

ItemUpdated Event Receiver how to change element from one list to secound list

I have got two lists. I must do synchronize this list, but one have got only 3 columns, and secound list have got 3 columns too, but have got more columns with hidden value. I done synchronizing ...
1
vote
1answer
175 views

Loading list items with CSOM ClientContext.Load: performance with LINQ

We have code like this: List list = clientContext.Web.Lists.GetByTitle("TestLib"); ListItemCollection items = list.GetItems(query); clientContext.Load(items, its => its....
0
votes
1answer
74 views

How to join two sharepoint list data using CAML or LINQ?

I have two lists: Doctors DoctorDetails In list #2 I have a lookup from list #1 i.e. on Doctor Name. Now I want to fetch data on the basis of doctor name as filter from both lists. How can I ...
1
vote
2answers
392 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
2answers
162 views

Create a dynamic WHERE clause with LINQ to SharePoint

I have a custom application where the user can select multiple (13) parameters to select data from a SharePoint list. To achieve this, I want to use LINQ to query this data from SharePoint. The ...
1
vote
1answer
459 views

Use GroupBy on ListItemCollection using CSOM

I am trying to do a GroupBy on a bunch of items that I have retrieved using CSOM and when I try do a foreach loop to go through them I get method not supported exception. List contactsList = context....
1
vote
0answers
40 views

SPMetal Error : An item with the same key has already been added

I am using the following command to generate entity class for Linq to SharePoint. spmetal.exe /web:http://mywebname:port /code:D:\CustomerClass.cs I am getting Error "An item with the same key has ...
0
votes
1answer
128 views

Using DataBase First Approach with EF in SharePoint?

I have seen here and there that Entity framework and Linq works with SharePoint. But can we use Entity framework Database first approach in SharePoint? http://cdn.rssbus.com/help/RS3/ado/...
2
votes
1answer
485 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 ...
0
votes
0answers
33 views

SPMetal - Specified cast is not valid

Here is the code : using (Entity_HoursReconDataContext context = new Entity_HoursReconDataContext("url")) { EntityList<HoursTrackingItem> Hours = context.GetList<HoursTrackingItem>("...
0
votes
1answer
115 views

Unable to return Microsoft.Sharepoint.Client.File object Names filtered by extension

I'm attempting to retrieve a set of File objects filtered by extension. The following code works correctly (without the filter). FolderCollection productModelFolders = _clientContext.Web.Lists....
0
votes
0answers
26 views

Get specific value from XML document using xml.Linq

I have the following XML structure of a SharePoint field: <Field ID="{734289E8-016E-4190-8D99-B1B65F1841A4}" DisplayName="Country" Type="TaxonomyFieldTypeMulti" ...
0
votes
1answer
38 views

Document Library Attachment Retrieval. LINQ vs CAML

In a particular project I am required to retrieve corresponding attachments to a request submitted by a user. On one page the live requests are displayed with links to the attachments. The project ...
0
votes
0answers
27 views

Improve performance when querying huge lists

I have a query which will be joining 3 lists, 1 of which has 50,000 items. Hence, when query is executed the page takes >10 secs to load. This query is being executed in a custom Sharepoint webpart. ...
0
votes
1answer
791 views

linq query for lookup list column error - query uses unsupported elements

I'm trying to return the list item ID (s.ID), and the ID of a lookup column (s.VendorID). I get the following error: The query uses unsupported elements, such as references to more than one list, ...
0
votes
1answer
594 views

Problem with join two lists by linq

I wanna join two list and fill drop down list by specific column but i have error in join query note:c.user_id is lookup field my code lst.DataSource = (from c in dc.Complainant ...
2
votes
2answers
411 views

Security token service and custom claims provider - strange error

I have a custom claims provider, which uses some services from another assembly. This service assembly basically uses Linq-to-SQL context to read data from database which then custom claims provider ...
0
votes
3answers
2k views

Is it possible to have CAML Join without Lookup Columns?

I am new to SharePoint. I am developing a web-part in that I am trying to join two list. I have a same web-part in that lists were join using LINQ query. But it takes more time to fetch the data. So ...
0
votes
1answer
492 views

Why would linq to sharepoint ever return null list items?

I am getting a null reference exception that I can't pin down. By process of elimination using a variety of assumptions I've narrowed it down to a single variable, a linq iteration variable, like so: ...
0
votes
0answers
67 views

Simplest way to connect a Visual Studio SharePoint App to my external Database

Hi all new to developing for SharePoint. As the title indicates I want to connect my Visual Studio SharePoint App that I have created to my external database. I have created the app and it works in ...
0
votes
1answer
15 views

External Content type linq error

I have a list with an externa content type. I am tring to fetch the element by server side code, but i get this exception: Microsoft.BusinessData.Infrastructure.BdcException This is my ...
0
votes
1answer
52 views

Access parent site list data via LINQ from subsite

I have an SP 2010 web part that access list data using LINQ. The data and the web part currently live on the top-level site. Would I be able to easily access that data in a different web part from a ...
1
vote
0answers
548 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 ...
0
votes
1answer
67 views

LINQ query taking long time

Following query i write it returns me 1400 records. and below line taking much time. 1.5 second taken by count = quer != null ? quer.Count() : 0; and 2 sec taken by candidateList = quer.Skip((...
0
votes
2answers
1k views

Linq to SharePoint 2013

Is it recommended to use Linq to SharePoint while developing projects for SharePoint 2013? or this became an old trend?
1
vote
2answers
6k views

Getting items from rows 4-8 in a Sharepoint list using CAML query?

Here is the code Im using to retrieve the first 4 most upcoming announcements from the OOTB announcements list in sharepoint: How do I modify this to retrieve the next 4 (5,6,7 and 8) most upcoming ...
7
votes
4answers
7k 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 ...
0
votes
4answers
4k views

OfType<SPListItem>() says SPListItemCollection does not contain a definition for OfType()

I'm using Linq to SharePoint rather than CAML to query list data from SharePoint. See the code I have written: SPList productsList = SPContext.Current.Web.Lists["Products"]; IEnumerable<SPListItem&...
0
votes
1answer
241 views

How to check sharepoint list date column is empty?

How to check sharepoint list date column is empty? I want to check in back end code. IEnumerable<DataRow> x = from laptop in dtList.AsEnumerable() join ...
0
votes
0answers
255 views

dataservicequeryexception is unhandled by usercode

var serviceUrl = "/_vti_bin/listdata.svc"; var context = new listservice.TestingEnvironmentDataContext(new Uri(serviceUrl)); context.Credentials = System.Net.CredentialCache.DefaultCredentials; var ...
0
votes
2answers
387 views

Linq get Distinct or first from multiple group

Ok, I'm not understanding something here with what I am attempting to query here. I have a list like the following. Title Subject Content Date ...
1
vote
2answers
439 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
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
26 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
1answer
452 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. ...
6
votes
2answers
12k 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 ...
0
votes
1answer
240 views

LINQ in SharePoint to order listitems

I have tried the following in CAML but it does not seem to be returning them sorted SPQuery query = new SPQuery(); query.Query = "<Query><OrderBy><FieldRef Name='Sequence ...
0
votes
3answers
2k views

Access Denied opening a list from another site collection

I am trying to access a list via LINQ to SharePoint that is part of a different site collection. I am able to create the DataContext object for the other site but when I try to access the DataContext....
0
votes
1answer
330 views

get count from groupby query of linq to xml

I need to group the elements in the xml by Article_x0020_Tags . Here I get the items from the sharepoint pages library , which has a custom column called "article Tags" which is a managed metadata ...
1
vote
1answer
656 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 ID="{F2572330-8163-460D-9016-...
0
votes
1answer
52 views

Shortcut to use LINQ

http://msdn.microsoft.com/en-us/library/ff742311.aspx Based on the link above you have to make a detour before you can use syntax code LINQ for SharePoint. If you have to do the same approach for ...
0
votes
1answer
126 views

How to get list items same values in each two list items to display in 3rd list using with caml query

How can I write one caml query to get items from two lists joined on empid? will you please anybody give me help with suitable caml query or even otherwise possible code. Note: There is no lookup ...
0
votes
1answer
199 views

get list item versions in linq to sharepoint

How can i access last approved list-items in linq to sharepoint. Actually I want equivalent of this statement in linq to sharepoint if (item.Versions[index].Level == SPFileLevel.Published)
0
votes
0answers
608 views

Values missing for dependent lookup column from parent list when using linq

Situation I have 2 site content types defined that are deployed as a site feature: Customer Name Address Order Value There is a second web feature that deploys a list to the root site for ...
1
vote
0answers
329 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 ...
0
votes
1answer
55 views

Linq & SharePoint 2007

Morning all, I'm aware that LINQ was packaged with SharePoint 2010 but I'm wondering on the feasability of tools such as Linqpad with SharePoint 2007. I've recently inherited a SharePoint 2007 farm ...
2
votes
1answer
503 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 = ...