Solved

custom site column not showing in LINQ Intellisence

Posted on 2011-03-07
3
716 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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 …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

705 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