none
Including the DynamicLinq.vb file into my project RRS feed

  • Question

  • I have a Dataset that I hydrate from an XML file (with schema)
    ( the Xml is created by DS.WriteXml(….)
    The Xsd is referenced in the project.
    So, I have a strongly typed dataset against which I can run Linq queries all day long.
    In addition, I run PredicateBuilder with much success.

    But, when I bring in the Dynamic Linq module from Scott Gu into my project, I get all sorts of low level errors like
    Error 9 'Windows' is not a member of 'System'. Q:\fooXml\fooXml\Form1.Designer.vb 
    Error 1 Type 'System.ComponentModel.Container' is not defined. 

    If I change the Namespace in DynamicLinq.vb From System.Dynamic.Linq to myRootNs.System.Dynamic.Linq
    the errors go away, but then I get this error when compiling the following statement

    Me.DataGridView1.DataSource = titles.AsQueryable.Select("CUSTOMER,PRDCT_GRP,PART_NO")


    Error 1 Overload resolution failed because no accessible 'Select' can be called with these arguments:
        Extension method 'Public Function Select(Of TResult)(selector As System.Func(Of CadDataSet.CadDataRow, Integer, TResult)) As System.Collections.Generic.IEnumerable(Of TResult)' defined in 'System.Linq.Enumerable': Data type(s) of the type parameter(s) cannot be inferred from these arguments. Specifying the data type(s) explicitly might correct this error.
        Extension method 'Public Function Select(Of TResult)(selector As System.Func(Of CadDataSet.CadDataRow, TResult)) As System.Collections.Generic.IEnumerable(Of TResult)' defined in 'System.Linq.Enumerable': Data type(s) of the type parameter(s) cannot be inferred from these arguments. Specifying the data type(s) explicitly might correct this error.

    Is there a step I am missing--does the namespace need to be changed? (Using VS2008 VB.Net and Express)


    A Developer
    Wednesday, September 23, 2009 8:03 PM

Answers

  • Hi Mark,

    When you include the file, remeber to include the references as in DynamicQuery and make the rootnamespce to blank(double click MyPorject).
    Then you'll get it work.


    Best Regards
    Yichun Feng
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Proposed as answer by Yichun_Feng Monday, September 28, 2009 10:36 AM
    • Marked as answer by Yichun_Feng Wednesday, September 30, 2009 1:29 AM
    Monday, September 28, 2009 10:36 AM