Solved

custom site column not showing in LINQ Intellisence

Posted on 2011-03-07
3
711 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

910 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

20 Experts available now in Live!

Get 1:1 Help Now