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

learn more… | top users | synonyms

0
votes
1answer
241 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
417 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
502 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
365 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
332 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 ...
1
vote
1answer
904 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 ...
0
votes
1answer
142 views

linq to sharepoint and excessive cpu usage issue

our project is using linq to sharepoint , its working well the only problem we are facing is the extra CPU usage its taking , even if only two or three users concurrently accesses the local testing ...
0
votes
1answer
287 views

EntityList empty when querying items provisioned in List Instance XML

I'm not sure if I have found a bug here or if I'm doing something wrong. I have a list which I provision using a SPI in Visual Studio, in the List Instance XML I provision some default list items ...
1
vote
0answers
179 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 ...
0
votes
2answers
95 views

How to use values from 2 item collections?

I'm trying to use values from 2 SPListItemCollections, as one of them have a lookup field with values from the other list. The reason why I need to do this, is because I need the value from the other ...
0
votes
2answers
1k views

Get Files from document library with LINQ

Hi I'm trying to get file from a documentLibray with LINQ Query. I've been trying with this code but I get nothing! var allegatiCollegati = (from SPFile attach in web.Lists.["Allegati"].items ...
0
votes
2answers
198 views

Delete item from COM. Don't find Item

I'm trying to delete but the code seems that can't find the Item field : try { using (ClientContext context = new ClientContext("http://to0wss2k10rey03/sites/ReplyCorp")) ...
0
votes
1answer
69 views

Get client query of a server query

I?m trying to get how can I get the query but on the client context? SPWeb webRoot = scSite.OpenWeb(); SPListItem selectedItem = (from SPListItem item in ...
1
vote
1answer
418 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
1answer
542 views

Dynamic LINQ to SharePoint

This question starts here: Dynamic LINQ to SharePoint and Projection how to build dynamic LINQ to SharePoint expression like this(but store "Bill", "Sam" in array): // Listing 1 // ...
3
votes
1answer
835 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 ...
1
vote
1answer
194 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
votes
2answers
827 views

Using linq to get aggregated total of distinct values from csv items in datatable

I am going to use linq to get datapoints for chart created in sharepoint from datatable this is datatable with 2 columns "task" and "users" task users task 1 john task 2 mike, ...
1
vote
2answers
621 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?
0
votes
0answers
259 views

Linq Data Context - connect from web part as application pool identity

I have an assembly with linq to sql mappings and I'd like to utilize it in my webpart. But when I try following: DataList dataList = new DataList(); dataList.DataSource = DB.Foo; ...
1
vote
1answer
148 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 ...
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 ...
2
votes
2answers
231 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 ...
0
votes
2answers
1k views

Using LINQ on an external list

When I create a list in SharePoint and want to run LINQ agaisnt it I use SPMetal to auto generate the mapping. SPMetal.exe /web:http://mysite /code:C:\MyFile.cs This does not seem to generate the ...
1
vote
0answers
249 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 ...
2
votes
2answers
1k 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 ...
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 ...
2
votes
1answer
449 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 = ...
0
votes
2answers
402 views

How can i access sharepoint using LINQ instead of CAML?

is there any way to access Sharepoint lists via LINQ instead of CaML?
3
votes
2answers
2k 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 ...
4
votes
1answer
599 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 ...
1
vote
1answer
145 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 ...
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 ...
0
votes
2answers
311 views

LINQ to SharePoint and SPUserToken

When creating a new Linq to SharePoint context, normally we don't pass a site object but we provide a request url. So what should I do if I want to execute Linq queries under a different user ...
0
votes
1answer
375 views

External CT Related Lists - Examples - CAML - LINQ to SharePoint

I'm trying to return related data via External Content Types. I was wondering which is better to use, CAML queries or LINQ to SharePoint? I'm fine with writing CAML queries besides the relating part ...
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 ...
2
votes
3answers
3k 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 ...
0
votes
1answer
322 views

SPLinq and PeoplePicker

I have a List where one of its field is based on the People Editor control. The field name is Organizer. How do I get the value if this field using SPlinq. When I iterate thru the list item in debug ...
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 ...
0
votes
1answer
2k views

Linq: How to use EntityLists to do a join on a lookup field?

I have 2 lists, one list contains a lookup to another. I have used SPMetal to generate entity.cs based on this article: ...
0
votes
2answers
755 views

LINQ to Sharepoint InsertOnSubmit Question

For example I have a list called Product and it has 3 columns, ProductName (which is the Title), ProductPrice and ProductType. ProductName is a string ProductPrice is a currency (double) ...
2
votes
4answers
567 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 ...
1
vote
2answers
976 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). ...
0
votes
1answer
255 views

Can I use .NET 3.5 language features in Sharepoint 2007

Can I use .NET 3.5 language features in SharePoint 2007. I want to use LINQ on an in memory collection (SPListItemCollection for example). I want to write extension methods. Can I do this with ...
5
votes
2answers
542 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.
1
vote
1answer
714 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 ...
0
votes
1answer
1k views

How can I update the record in sharepoint 2010 using linq?

I am unable to update the record in SharePoint 2010 using new linq feature. follwoing in my code please review it. AbsentTrackingSystemEntitiesDataContext ctx = new ...
5
votes
1answer
391 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 ...
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 ...