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. Typed DataSet and Linq Woes

Typed DataSet and Linq Woes

Scheduled Pinned Locked Moved LINQ
csharpdatabaselinqquestion
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.
  • R Offline
    R Offline
    RB Emphasys
    wrote on last edited by
    #1

    Hello All, I love linq, I even love linq with typed datasets, but the isnull() functionality is driving me nuts. We are required to use a dataset in a product of ours, and although I can write slick joins with linq, everytime a come across a nullable column, i'm writing what seems like needless code, (well that's my attitude since nullable types surfaced). My question is two fold, 1., has anyone come up with an elegant way to convert or handle nullable columns in datasets as nullable types. 2. Can you do write a linq query with a multiple condition join, like this:

    (from fm in _oRentCalcDataSet.FamilyMember
    join f in _oRentCalcDataSet.Family
    on !fm.IsfkFamilyNull() && fm.fkFamily equals f.PK

    I'm not having much luck. Thanks! Ryan

    J 1 Reply Last reply
    0
    • R RB Emphasys

      Hello All, I love linq, I even love linq with typed datasets, but the isnull() functionality is driving me nuts. We are required to use a dataset in a product of ours, and although I can write slick joins with linq, everytime a come across a nullable column, i'm writing what seems like needless code, (well that's my attitude since nullable types surfaced). My question is two fold, 1., has anyone come up with an elegant way to convert or handle nullable columns in datasets as nullable types. 2. Can you do write a linq query with a multiple condition join, like this:

      (from fm in _oRentCalcDataSet.FamilyMember
      join f in _oRentCalcDataSet.Family
      on !fm.IsfkFamilyNull() && fm.fkFamily equals f.PK

      I'm not having much luck. Thanks! Ryan

      J Offline
      J Offline
      Jon Rista
      wrote on last edited by
      #2

      LINQ will ignore nulls by default...you shouldn't have to explicitly check for it. Remove the !fm.IsfkFamilyNull() from your join and see if that works.

      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