Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:44:39+00:00 2026-05-26T19:44:39+00:00

My LINQ query is as follows Dim Query = From t In New XPQuery(Of

  • 0

My LINQ query is as follows

Dim Query = From t In New XPQuery(Of xUser)(Xpo.Session.DefaultSession)
.Where("Name=John").Select("new (Name as FirstName)")

Unfortunately i get the error No property or field 'John' exists in type 'xUser'

Of course no such property exists in my xUser class, but hot can i fix that?

After reading within the DynamicLinq Class i found this function

Function FindPropertyOrField(ByVal type As Type, ByVal memberName As String, ByVal staticAccess As Boolean) As MemberInfo
    Dim flags As BindingFlags = BindingFlags.Public Or BindingFlags.DeclaredOnly Or _
        If(staticAccess, BindingFlags.Static, BindingFlags.Instance)
    For Each t As Type In SelfAndBaseTypes(Type)
        Dim members As MemberInfo() = t.FindMembers(MemberTypes.Property Or MemberTypes.Field, _
            flags, type.FilterNameIgnoreCase, memberName)
        If members.Length <> 0 Then Return members(0)
    Next
    Return Nothing
End Function

How can i edit my “faulty” query? What am i doing wrong here?

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:44:40+00:00Added an answer on May 26, 2026 at 7:44 pm

    Try to set ‘John’ as a parameter instead of directly in the string.

    Here you can find some documentation which shows this. It would look like .Where("Name=@0", "John")

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written a simple linq query as follows: var query = from c in
I have linq query as follows: var result = (from Customer cust in db
I have a GridView that is built from a Linq query as follows var
I have a simple LINQ query on ADO.NET Entity Framework as follows var result
I have the follow Linq query ... which executes correctly: from t in Tasks
I have this LINQ query (sorry it;s a long one) that query sets from
Can a Linq query retrieve BLOBs from a Sql Database? And how do they
I have a query that can be summarised in SQL as follows; Select S.StockCode
I've got a SQL query, that works as follows: SELECT TOP 100 Max(Table_ID) as
In our C# code I recently changed a line from inside a linq-to-sql select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.