Questions tagged [spmetal]

SPMetal is a very useful tool in Sharepoint 2010, introduced by Microsoft for creating Entity Data Model of the underlying Sharepoint lists. Though it is still at a very nascent stage, it can still be very productive as far as sharepoint customization in .Net is concerned.

Filter by
Sorted by
Tagged with
0 votes
1 answer
76 views

Is there any way to know why SPMetal is not generating classes?

Running SPMetal on Sharepoint site or any of its subsites returns object reference not set to an instance of an object Is there a log or any way to find out what's going wrong? I cant seem to ...
Georgia Kalyva's user avatar
0 votes
0 answers
2k views

CSOM not working for different users. "No credentials are available in the security package" returned

I have an ASP.NET MVC 5 application running. It reads and feeds most of its data from a SharePoint portal (but it is not running as a SP App, but independently). Since performance is not a critical ...
Mamsaac's user avatar
  • 123
0 votes
1 answer
270 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)
nit's user avatar
  • 181
0 votes
1 answer
164 views

SPMetal generating unique enums for each choice field with same values

I use SPMetal on two lists on my SharePoint site and there are several columns with choice field who have the same choices. <Field Name='Colors1' Type='Choice'> <CHOICES> <...
user3021521's user avatar
2 votes
0 answers
54 views

spmetal generates code for all sharepoint lists except one

I used SPMetal to generate code for the lists on my SharePoint site as per these instructions. I have several custom lists on the site. SPMetal generates code for all of the lists except one. There is ...
LFurness's user avatar
  • 682
0 votes
1 answer
620 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: ...
Nacht's user avatar
  • 1,231
0 votes
1 answer
358 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 ...
Ryan Erickson's user avatar
0 votes
1 answer
93 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?
Frank Martin's user avatar
  • 3,646
2 votes
1 answer
269 views

Can I run an app using SPMetal (Linq 2 SharePoint) on a non-SharePoint server?

I don't yet have a development VM with SharePoint installed (I have been using SPServices and JavaScript up to this point), so I cannot quickly answer this for myself... I am interested in ...
Kevin's user avatar
  • 472
1 vote
1 answer
951 views

SPMetal.exe : could not create entity file

I use this command: SPMetal /web:http://intranet.contoso.com/sites/Lab05 /code:Entities.cs /language:csharp for creating the entity file Entities.cs, but I get the error: Must specify source ...
SPBeginer's user avatar
  • 2,537
0 votes
0 answers
599 views

SPMetal insert item with lookup column throwing exception stating that there is a field that is read only

I have the following code protected void BetOnCar_Click(object sender, EventArgs e) { DerbyDataContext context = new DerbyDataContext(SPContext.Current.Web.Url); int carId = ...
Josh's user avatar
  • 226
1 vote
2 answers
1k views

SPMetal getting picture thumbnail url

I am making a custom web part and need to be able to pull a picture thumbnail from a picture library. I am using SPMetal generated classes and don't see a way to do this. It seems that thumbnails ...
Josh's user avatar
  • 226
5 votes
1 answer
708 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 ...
John's user avatar
  • 3,773
0 votes
2 answers
3k views

SPFieldUserValue and SPPrincipal

I have a complex application that have several field of type UserMulti. These fields can accept either SPUser or SPGroup or a combination of both kind. I have in my code the ID and the name of a ...
Steve B's user avatar
  • 7,488
1 vote
0 answers
191 views

Auto inserting SPMetal child entities?

Let's say I have two lists in my web site, linked by a lookup : List A (content type ACT) Title (text) List B (content type BCT) Title (text) A (lookup to A) I use SPMetal to generate a ...
Steve B's user avatar
  • 7,488
3 votes
1 answer
606 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 ...
Steve B's user avatar
  • 7,488
0 votes
1 answer
364 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 ...
Alex Clark's user avatar
0 votes
1 answer
665 views

SPMetal, lookups without EntityRef

I defined site definition with two content types and two list definitions. I have lookup site column <Field ID="{4318c52f-11c6-129a-b832-5ab22450b17c}" Type="Lookup" List="Lists/...
Roman Badiornyi's user avatar
1 vote
0 answers
203 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 ...
Roman's user avatar
  • 313
0 votes
2 answers
1k views

Content Management Document Library - How to get Approval Status column value using SPMetal LINQ

I am trying to pull data from Content Management Document library , Äpproval Status is not a actual document library column. It was enabled through Content Management Feature.... How to i access ...
Jaffar's user avatar
  • 11
2 votes
0 answers
247 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 SPSiteDataQuery,...
Jasper's user avatar
  • 1,264
1 vote
0 answers
281 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 ...
Becca Dee's user avatar
  • 239
0 votes
1 answer
471 views

SPMetal Person column generation

I'm using SPMetal to generate a class for my lists to use in a Sandbox-solution (with Sandbox Visual WebParts). However, when I generate the classes for a list column of type "Person or Group" with ...
RajenK's user avatar
  • 101
0 votes
1 answer
500 views

SPMetal, Taxonomy and TaxonomyFieldValue

I have a list with a taxonomy column. I have made SPMetal classes to work with my site. But SPMetal doesn't create the property for taxonomy column, so I have extended my class by the ICustomMapping ...
Alberto Bevilacqua's user avatar
2 votes
3 answers
5k 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 ...
Flo's user avatar
  • 1,330
1 vote
0 answers
592 views

Why does SPMetal ignore lookup columns in Farm Solution

I have content types and related lists (via lookup columns) in a Sandbox solution(.wsp). All my lookup column relationships come up fine in the SPMetal generated entity classes. I now have a ...
Ralph W's user avatar
  • 988
5 votes
3 answers
626 views

Access binary data of an SPFile through an SPMetal generated entity

I've used SPMetal to generate my DataContext and classes for my custom Content Types. Some of these Content Types derive from Document content type. I need to run a Linq query against a Document ...
Jaap Vossers's user avatar
  • 5,040
2 votes
4 answers
609 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 ...
Bassel Alkhateeb's user avatar
1 vote
2 answers
443 views

SPMetal Generating Duplicate Classes

SPMetal is creating duplicate entities when I attempt to generate code with the following conditions. I have a custom content type [Person] that inherits from [Contact]. I have created a list ...
DigitalNomad's user avatar
1 vote
1 answer
759 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 ...
user avatar
5 votes
1 answer
420 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 ...
John Hansen's user avatar