Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. asp.net dynamic linq query

asp.net dynamic linq query

Scheduled Pinned Locked Moved Visual Basic
csharpasp-netdatabaselinqcom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    murali_utr
    wrote on last edited by
    #1

    hi Dim job = From J In QryGen.co_jobs Where J.co_id = 1013 And J.industry_mas_id = 5 Order By J.job_id Descending Select New With {J.job_id} this my query. in this I would like construct the query on runtime for where condition. sometime need to include some other fields to where condition. I need help. Thanks in advance.

    Have A Nice Day! Murali.M Blog

    Richard DeemingR 1 Reply Last reply
    0
    • M murali_utr

      hi Dim job = From J In QryGen.co_jobs Where J.co_id = 1013 And J.industry_mas_id = 5 Order By J.job_id Descending Select New With {J.job_id} this my query. in this I would like construct the query on runtime for where condition. sometime need to include some other fields to where condition. I need help. Thanks in advance.

      Have A Nice Day! Murali.M Blog

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Try chaining the Where clauses:

      Dim query As IQueryable(Of Job) = QryGen.co_jobs

      If filterById Then
      query = From J in query Where J.co_id = 1013 Select J
      End If

      If filterByIndustry Then
      query = From J in query Where J.industry_mas_id = 5 Select J
      End If

      Dim job As IQueryable(Of Job) = From J in query Order By J.job_id Descending Select New With { J.job_id }


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups