Questions tagged [linq-to-sharepoint]

27 questions
0
votes
1 answer

Using LinqDataSource with linq to sharepoint for paging

I am developing a a Sharepoint 2010 visual webpart and I am trying to use LinqDataSource in it to handle paging and sorting in a GridView. I made my datacontext and entity objects with spmetal. and now this is my code: my mark up: <%@ Register…
0
votes
0 answers

How to make a condtion in a a lambda expression when assigning a value

I am trying to assign a value to my item but i need to put a condition because the id changes depending of the language. Expression>[] fieldsToRetreive = new Expression>[] { item =>…
0
votes
1 answer

SharePoint Lookup (Count Related) value in Linq Query

I have two lists, Posts and Comments. Comments has a Lookup column to the Posts list, and the Posts has a Lookup (Count Relate) relationship back to the Comments list. What I'm trying to do is just display the number of Comments in each Post. For…
0
votes
1 answer

Multichoice fields with dynamic linq

I'm making a SP2010 page where user can filter items by their phase (It's a multichoice field). For performance reasons and the nature of the filters I had to resort to System.Linq.Dynamic to make this query. I've tried the following (this is not…
jpiolho
  • 1,192
  • 11
  • 12
0
votes
1 answer

Linq to Sharepoint "where" clause cannot be found

Hello stackoverflowers, I'm trying to use LINQ to Sharepoint for the first time, but my where keyword isn't recognized : "Could not find an implementation of the query pattern for source type 'Microsoft.SharePoint.SPList'. 'Where' not found". Here…
Ythio Csi
  • 379
  • 2
  • 14
0
votes
1 answer

NotSupportedException when using Generic Operation in LINQ

At work I have to make a console application which can contact a WCF service at Sharepoint, pull out some data from a list and compare it to some data from our Microsoft SQL Server Database. Now, I almost got it down but I have run into some issues…
OmniOwl
  • 5,477
  • 17
  • 67
  • 116
0
votes
1 answer

Specified cast is not valid querying Sharepoint

Using SPMETAL I've generated a C# file allowing me the use of LINQ to access Sharepoint objects. However, using a very simple query produces a strange error: Specified cast is not valid. Stack trace: at Set__zleceniaTrigger(Object ,…
MBender
  • 5,395
  • 1
  • 42
  • 69
0
votes
1 answer

Query that get the projects whose name 'starts with'. Project Server 2013

Attempt to obtain projects that begin with a particular word , but I get the following error: "The 'StartsWith' member cannot be used in the expression." ProjectContext projContext = new ProjectContext(urlPWA); projContext.Credentials = new…
0
votes
2 answers

SPMETAL / LINQ to SharePoint Decimal Types

I've hit a pretty major snag with the entities generated by spmetal / linq to sharepoint. I am hoping someone has dealt with this before.. or maybe I am missing something obvious. Let's say we have a list with a number field. The field will be…
mikeds
  • 187
  • 3
  • 11
0
votes
1 answer

Generate LINQ classes with SPMetal for Site Collection in Sharepoint

I try to generate LINQ classes for my Site Collection root in Sharepoint with this command (all in one line): SPMetal.exe /web:http://myserver /namespace:mynamespace /code:myfile.cs /parameters:mysettings.xml The mysettings.xml looks like…
Marc
  • 6,749
  • 9
  • 47
  • 78
0
votes
1 answer

Get SPListItem from Linq to Sharepoint result

I access a Sharepoint list with Linq-to-Sharepoint and iterate over the items in the result. The items are (of course) just generated classes with only the properties from that list. But I need some meta info to every item which I would have if I…
Marc
  • 6,749
  • 9
  • 47
  • 78
0
votes
2 answers

Columns associated with mappings have been deleted/renamed

I have a Content Type called Activity that inherits form Event and i have a list instance called Activities and its content type is Activity When SPMetal Generates the entities i see the following classes public partial class Activity : Event and…
1
2