none
Strongly Typed Column in Linq to Dataset RRS feed

  • Question

  • I had been developing a solution in visual studio 2008 where I had the following query:

    Dim result = From y In DaysTable _
                   Where y.DateTimeColumn.Day = currentDateIndex Select _
                   y.DescriptionColumn, y.MiscColumn, y.CodeColumn Distinct

    DaysTable is a type datatable from a typed dataset. I got intellisense for the column types as you can see. I had option infer turned on so that I could use anonymous types. Life was great.

    Then, our company installed a new developer framework, and I opened a new solution using their new framework. This new framework is not supposed to have an effect on .net 3.5 at all. For reasons I don't want to go into at this point, I do not have the references on the old solution.  In any event, I copied all the datasets and the linq code to the new solution and it would not compile. I could not get intellisense on the column names. The following error is received:

    'DateTimeColumn' is not a member of 'System.Data.DataRow'. It seems that the compiler does not want to give me access to the strongly typed datarow that I already have. I assumed the problem was in the references. I slowly added any dll that remotely seemed to be pertinent. I currently have

    system.core
    system.xml.linq
    system.data.dataextensions
    system.configuration

    among others. All of them are from 3.5 framework.  Can anyone help me??
    Thank you in advance for any responses.
    Thursday, March 19, 2009 7:14 AM