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. C#
  4. DataTable.Select

DataTable.Select

Scheduled Pinned Locked Moved C#
databasecsharpquestion
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.
  • J Offline
    J Offline
    jesarg
    wrote on last edited by
    #1

    In .NET 2.0, assume that I have some SQL written along the lines of: Select child.name, parent.name From person child, person parent On child.ParentId = parent.Id Where child.category = 55 I now have to convert this SQL so that it selects from a cached DataTable of people instead of directly from the database. Is there an elegant way to convert this SQL using DataTable.Select (or some other DataTable method)? (I realize that if there was just one Person in the SQL statement this would be simple.)

    A 1 Reply Last reply
    0
    • J jesarg

      In .NET 2.0, assume that I have some SQL written along the lines of: Select child.name, parent.name From person child, person parent On child.ParentId = parent.Id Where child.category = 55 I now have to convert this SQL so that it selects from a cached DataTable of people instead of directly from the database. Is there an elegant way to convert this SQL using DataTable.Select (or some other DataTable method)? (I realize that if there was just one Person in the SQL statement this would be simple.)

      A Offline
      A Offline
      Andrew Rissing
      wrote on last edited by
      #2

      If you've got relationships setup, you'll need to do something found at: Select Statement Syntax[^] Look for the section - "PARENT/CHILD RELATION REFERENCING"

      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