Solved

custom site column not showing in LINQ Intellisence

Posted on 2011-03-07
3
712 Views
Last Modified: 2012-05-11
Hi,
I have a custom content type which is not showing up in LINQ Intellisence.

I already ran the SPmetal.exe to create the MyEntitiesDataContext Class. The list is though showing up in the LINQ intellisence.
However, the list is associated with the custom content type. And, the custom column is not showing up in LINQ Intellisence.
How can i bring in the custom column in LINQ Intellisence.
0
Comment
Question by:me24hour
  • 3
3 Comments
 

Author Comment

by:me24hour
ID: 35063012
Here are more details I would like to provide

            using (MyEntitiesDataContext sq = new MyEntitiesDataContext(currentSPsite.Url))
            {
                //Using LINQ to work with DataContext Object to fetch LSO Num from SequentialIDs list
                //EntityList<SeqlID> sequentialIDs = sq.GetList<SeqlID>("SequenceIDs");

                var q = from unique_Id in sq.SequentialIDs
                        where unique_Id.Title.StartsWith("LSO")
                        select new
                        {
                            unique_Id.Id,
                            unique_Id.Title,
                        };

                foreach (var a in q)
                {
                    iLsoNum = Convert.ToInt32(a.Id);
                    iLsoNum = iLsoNum + 1 ;                    
                }
            }        


In the above code the list 'SequentialIDs' has a custom column unique_Id. However, the intellisence is not picking up that column.

thanks in advance for any given help...!!
0
 

Accepted Solution

by:
me24hour earned 0 total points
ID: 35071512
Hi Guys,
After struggling for a day, I finally found the solution.
Actually, in my case, SPMetail.exe was not recognizing the custom content type.
It was associating the list with the parent content type which in my case was item.

To resolve the issue I changed the contenty type for the custom list in the entitydatacontext.cs file.
            [Microsoft.SharePoint.Linq.ListAttribute(Name="SequentialIDs")]
        public Microsoft.SharePoint.Linq.EntityList<Ct_Unique_Id> SequentialIDs
        {
                  get {
                return this.GetList<Ct_Unique_Id>("SequentialIDs");
                  }
            }

The following blog was helpful:
http://rgielen.blogspot.com/2010/10/spmetal-linq-to-sharepoint-2010.html
0
 

Author Closing Comment

by:me24hour
ID: 35071516
Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now