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. LINQ
  4. Is this a possibiliy?

Is this a possibiliy?

Scheduled Pinned Locked Moved LINQ
comtutorialquestion
2 Posts 2 Posters 2 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.
  • S Offline
    S Offline
    Sebastien Lachance
    wrote on last edited by
    #1

    I'm wondering if this is possible with LinqToSQL. I have a table, named Request Request have those 3 columns : ID, MessageID and State Example of data in the table : 1, 1, Completed 2, 1, Ready 3, 2, Completed 4, 2, Completed Let's say I want all request with the same message ID which have both their state set to completed. X| In this example I need : 3,2,Completed 4,2,Completed But not the first two because one of them does not have all their state set to completed. Is this possible with only LinqToSql (no stored proc)? :confused:

    My Blog

    J 1 Reply Last reply
    0
    • S Sebastien Lachance

      I'm wondering if this is possible with LinqToSQL. I have a table, named Request Request have those 3 columns : ID, MessageID and State Example of data in the table : 1, 1, Completed 2, 1, Ready 3, 2, Completed 4, 2, Completed Let's say I want all request with the same message ID which have both their state set to completed. X| In this example I need : 3,2,Completed 4,2,Completed But not the first two because one of them does not have all their state set to completed. Is this possible with only LinqToSql (no stored proc)? :confused:

      My Blog

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Maybe I'm missing something, but shouldn't this work?

      var matches = from request in RequestTable
                  where request.MessageId == 2 and request.State == State.Completed
                  select request;

      Life, family, faith: Give me a visit. From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord." Judah Himango

      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