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. Database & SysAdmin
  3. Database
  4. DataTable.Select()

DataTable.Select()

Scheduled Pinned Locked Moved Database
csharp
4 Posts 3 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.
  • A Offline
    A Offline
    amatyasik
    wrote on last edited by
    #1

    Hi ! (Sorry for my bad english ;P) I use datatable and i would search if a row exist, i've tried with the Select method but in some rows contains {null} values and i c'ant find how i'll passed this values in the Select string #I Work in VB.NET dim filter as String = "COL1 = 1 AND COL2 = **null**" If ldataset.Tables("Table1").Select(filter).length Then ....:doh: End If Thanks in advance :-D

    G E A 3 Replies Last reply
    0
    • A amatyasik

      Hi ! (Sorry for my bad english ;P) I use datatable and i would search if a row exist, i've tried with the Select method but in some rows contains {null} values and i c'ant find how i'll passed this values in the Select string #I Work in VB.NET dim filter as String = "COL1 = 1 AND COL2 = **null**" If ldataset.Tables("Table1").Select(filter).length Then ....:doh: End If Thanks in advance :-D

      G Offline
      G Offline
      Guillermo Rivero
      wrote on last edited by
      #2

      Try This filter = "COL1 = 1 AND IsNull(COL2,-1)=-1" (if COL2 is numeric) filter = "COL1 = 1 AND IsNull(COL2,'')=''" (if COL2 is string) Free your mind...

      1 Reply Last reply
      0
      • A amatyasik

        Hi ! (Sorry for my bad english ;P) I use datatable and i would search if a row exist, i've tried with the Select method but in some rows contains {null} values and i c'ant find how i'll passed this values in the Select string #I Work in VB.NET dim filter as String = "COL1 = 1 AND COL2 = **null**" If ldataset.Tables("Table1").Select(filter).length Then ....:doh: End If Thanks in advance :-D

        E Offline
        E Offline
        EdbertP
        wrote on last edited by
        #3

        Shouldn't it be "COL2 IS NULL" ?

        1 Reply Last reply
        0
        • A amatyasik

          Hi ! (Sorry for my bad english ;P) I use datatable and i would search if a row exist, i've tried with the Select method but in some rows contains {null} values and i c'ant find how i'll passed this values in the Select string #I Work in VB.NET dim filter as String = "COL1 = 1 AND COL2 = **null**" If ldataset.Tables("Table1").Select(filter).length Then ....:doh: End If Thanks in advance :-D

          A Offline
          A Offline
          amatyasik
          wrote on last edited by
          #4

          thanks to everyone.... :-D it's so easy .... :omg:

          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