Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
7 views

Filter MultiValueLookupFeild Using Linq

I have Following Linq which converts result set into list. i am getting perfect result but than i have to convert this list to datatable but it throws error that "XYZ" column already exist in ...
0
votes
0answers
18 views

Convert LINQ query to CAML

Please anybody help to convert below LINQ code to CAML:- var objPendingRequest = from reqHeader in objResourceAllocation.RequestHeader.ScopeToFolder("", true).ToList() join reqDetail in ...
0
votes
1answer
63 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
69 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
89 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 ...
0
votes
4answers
512 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"]; ...
1
vote
0answers
161 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
148 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
23 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
131 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. ...
0
votes
1answer
83 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
1answer
41 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
88 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
92 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
1answer
147 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 ...
0
votes
1answer
384 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
0answers
343 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
199 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
42 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 ...
1
vote
0answers
56 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 ...
3
votes
2answers
149 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 = ...
0
votes
1answer
300 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
2answers
148 views

how to update Listdata with Linqpad and wcf?

I am a lazy person, therefor I like to not scratch up a small concsole application if I don't need to. I'd like to update a few listitems via Linqpad. I can query the items just fine, but how do I ...
0
votes
1answer
223 views

Is SPMetal and LINQ to SharePoint worth using?

I have recently run into a number of issues with SPMetal and LINQ to SharePoint that is making me wonder if it is worth it. In what cases does it make sense to use SPMetal and in what cases does it ...
0
votes
1answer
390 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 ...
0
votes
1answer
61 views

Understanding SPMetal and Linq

If I generate .cs file using SPMetal for my site and then use it in Visual Studio to develop web part using Linq. And later on I create a new list in my site, will I need to generate .cs file again?
1
vote
1answer
401 views

Join multiple lists using XML web service

Implement a new XML web service, in the web service, use the SharePoint API to merge or join two or more list. Then, in SSRS, retrieve data from the XML web service using XML data source type. ...
0
votes
1answer
61 views

DirectoryNotFoundException when trying to read Picture Library using Linq

I am trying to read a picture library named "ImageLibrary" as follows: SPList list = web.GetList("ImageLibrary"); But I am getting following error: DirectoryNotFoundException How do I read ...
0
votes
3answers
2k views

Better way to get a SPListItem by Field

I want to get a SPListItem from a SPList where a field match a value. I have to ways to do it, CAML and LINQ. My code is: LINQ ... SPList list = Web.Lists["MyList"]; SPListItem item = (from ...
1
vote
1answer
178 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 ...
0
votes
2answers
364 views

Looking for fast way to get Listitem Count

My problem ist related to this question. In order to get the basic statistics I need the total item count. However the basic LINQ query (from t in Tickets select t).Count(); or Tickets.Count(); ...
0
votes
3answers
1k 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 ...
1
vote
0answers
39 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 ...
6
votes
2answers
5k 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
3answers
1k 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 ...
1
vote
1answer
318 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 ...
1
vote
1answer
293 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
1answer
571 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 ...
4
votes
4answers
5k 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 ...
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
0answers
63 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
0
votes
1answer
275 views

How to access Yes/No field of Sharepoint List using Linq?

I have one list in which there is field with the datatype of Yes/No. I am trying to retrieve data of that field but it is giving me following error : System.InvalidCastException: Specified cast is ...
0
votes
2answers
3k 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 ...
6
votes
3answers
816 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 ...
0
votes
1answer
306 views

How to do Scope=RecursiveAll with Linq To Sharepoit

I have the following CAML query: caml = string.Format("{0}", code); query = new SPQuery { Query = caml, ViewAttributes = "Scope = \"RecursiveAll\"" }; This query search in a document library a list ...
0
votes
1answer
232 views

How to iterage through Message content type in Discussion list

I need to iterate through all the columns (default + custom) in Message content type in Discussion list. i have used this code: //select a single discussion (in this case, the first one), to view ...
5
votes
1answer
402 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 ...
2
votes
0answers
492 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 ...
1
vote
2answers
359 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 ...
3
votes
1answer
306 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 ...