LINQ inside webpart

Feb 20, 2009 at 3:10 PM
I just started with sharepoint webpart development so i'm a little in the unknown.  I made a WSPBuilder Project and then added a webpartfeature and put in some code to query my mssql using linq. The references for System.Core and System.Data.Linq can't be added to make my linq compile.  Am I limited to what I can develop in a webpart?  Is there another way like I have to call a webservice to get my data so the LINQ is done outside of this webpart?
Feb 20, 2009 at 4:10 PM
Ok, I figured it out. My oversight. When I created the WSPBuilderProject it was set as .NET Framework 2.0 in the project settings.  Once I changed it to .NET 3.5 which is what I normally use I could then use LINQ.  I built, deployed and it worked beautifully.
Dec 14, 2010 at 5:14 PM

Thanks for this. I was stuck with the same issue.