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. How to set null values in dataset ?

How to set null values in dataset ?

Scheduled Pinned Locked Moved Database
helptutorialquestion
3 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.
  • S Offline
    S Offline
    susree
    wrote on last edited by
    #1

    I am having one column whose datatype is datetime . so how to set null values in that column ? when I am passing null values its throwing some error as it is getting initialised to'01/01001' can anyone help me out? thanks

    M 1 Reply Last reply
    0
    • S susree

      I am having one column whose datatype is datetime . so how to set null values in that column ? when I am passing null values its throwing some error as it is getting initialised to'01/01001' can anyone help me out? thanks

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      You don't say what your data access library is. If you're using classic ADO editing a Recordset, just set the value to Null. This also applies to calling a stored procedure or substituting parameters in command text: set the appropriate Parameter to Null. From C++, you would use a variant with the vt member set to VT_NULL. If you're editing a DataTable with ADO.NET, you can use the DataRow object's SetNull method, or you can assign the appropriate column DBNull.Value.

      S 1 Reply Last reply
      0
      • M Mike Dimmick

        You don't say what your data access library is. If you're using classic ADO editing a Recordset, just set the value to Null. This also applies to calling a stored procedure or substituting parameters in command text: set the appropriate Parameter to Null. From C++, you would use a variant with the vt member set to VT_NULL. If you're editing a DataTable with ADO.NET, you can use the DataRow object's SetNull method, or you can assign the appropriate column DBNull.Value.

        S Offline
        S Offline
        susree
        wrote on last edited by
        #3

        hi , thanks for a prompt reply. I am editing a DataTable ,In that datatable I am having one datacolumn of datatype Datetime .so when I am setting the value DBNull.Value it's throwing null exception. I have tried with setnull method of datarow also but that method is not accessible. can you please help me out ?

        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