Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error
Dynamic LINQ - Error Dynamic LINQ - Error
Dynamic LINQ - Error
Go Back  Xtreme Visual Basic Talk > > > Dynamic LINQ - Error


Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2013, 05:52 AM
Beethoven's Avatar
Beethoven Beethoven is offline
Centurion
 
Join Date: Jun 2002
Location: Athens, Greece
Posts: 142
Default Dynamic LINQ - Error


Hi all,

I am trying to build a dynamic Select with DynamicLinq and I am facing the following error.

Here is the code:
Code:
  

Imports WorkAtXXX.NewNS.Linq.Dynamic
Imports System.Linq.Expressions

Private Sub btnRunQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRunQuery.Click

        Dim cont As New workatINGEntities_views
        Dim vw_Results As IQueryable

        divResults.Visible = True
        divEntitySelector.Visible = False
        divRebuild.Visible = True

        Dim QueryToRun As Collection = ConstructQuery("Absences")

        Dim strWHERE As String = QueryToRun.Item(1).ToString
        Dim strSELECT As String = QueryToRun.Item(2).ToString

        If strWHERE <> "" Then
            vw_Results = cont.vw_AbsencesReportingModel.Where(strWHERE).Select(strSELECT).Distinct
        Else
            vw_Results = cont.vw_AbsencesReportingModel.Select(strSELECT).Distinct
        End If


        grdResults.DataSource = vw_Results
        grdResults.DataBind()

    End Sub
The strSELECT that is produced is the following: "New(fldCorporateKey, fldFirstName, fldLastName)"

When I run this I am gettint the following Error Message:
'New' cannot be resolved into a valid type or function. Near simple identifier, line 2, column 8.

Could you please help me with this?

Thank you.
__________________
Allways try to go further from where you are.
Reply With Quote
Reply

Tags
dynamiclinq, linq


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error Dynamic LINQ - Error
Dynamic LINQ - Error
Dynamic LINQ - Error
 
Dynamic LINQ - Error
Dynamic LINQ - Error
 
-->