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. Column with Null value

Column with Null value

Scheduled Pinned Locked Moved Database
csharpasp-netquestionlearning
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.
  • M Offline
    M Offline
    Mri1a
    wrote on last edited by
    #1

    hi!1 Actually i am a beginner with asp.net and databases . i want to know that how can i access values from a table where some column name has null value say parentId ..

    Mrinal

    M P 2 Replies Last reply
    0
    • M Mri1a

      hi!1 Actually i am a beginner with asp.net and databases . i want to know that how can i access values from a table where some column name has null value say parentId ..

      Mrinal

      M Offline
      M Offline
      Mri1a
      wrote on last edited by
      #2

      what if one value is int type and the other is null type

      Mrinal

      M 1 Reply Last reply
      0
      • M Mri1a

        what if one value is int type and the other is null type

        Mrinal

        M Offline
        M Offline
        M LN Rao
        wrote on last edited by
        #3

        SqlDataReader r =//..some code.. int ParentId; //short form r.IsDBNull(r.GetOrdinal("ParentId"))?-1:Convert.ToInt32(r["ParentId"]); OR int ParentId = -1; if (!r.IsDbNull(r.GetOrdinal("ParentId"))) { ParentId = Convert.ToInt32(r["ParentId"]); }

        Intelligence is measured by common sense not by how many scholarly books you read.

        1 Reply Last reply
        0
        • M Mri1a

          hi!1 Actually i am a beginner with asp.net and databases . i want to know that how can i access values from a table where some column name has null value say parentId ..

          Mrinal

          P Offline
          P Offline
          Paddy Boyd
          wrote on last edited by
          #4

          SELECT AField FROM ATable WHERE parentId is null

          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