Solved

custom site column not showing in LINQ Intellisence

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

16 Experts available now in Live!

Get 1:1 Help Now