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. Web Development
  3. ASP.NET
  4. Update a null value into database

Update a null value into database

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasevisual-studiohelpquestion
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.
  • C Offline
    C Offline
    caheo
    wrote on last edited by
    #1

    I have this piece of code, I want to set this parameter could be a null value: OleDbParameter myParam = new OleDbParameter ( "Description", OleDbType.BigInt, 100 ); myParam.IsNullable = true; myParam.Direction = ParameterDirection.Input; } It did not work on my Visual Studio .Net 2003 even though I already using System.Data.OleDb; I saw there was something like set_IsNullable. I tried use myParam.set_IsNullable(true). It throws me this error:"cannot explicitly call operator or accessor". Is there an alternative way ? Also, if there is a solution how I can I set the value is null

    C 1 Reply Last reply
    0
    • C caheo

      I have this piece of code, I want to set this parameter could be a null value: OleDbParameter myParam = new OleDbParameter ( "Description", OleDbType.BigInt, 100 ); myParam.IsNullable = true; myParam.Direction = ParameterDirection.Input; } It did not work on my Visual Studio .Net 2003 even though I already using System.Data.OleDb; I saw there was something like set_IsNullable. I tried use myParam.set_IsNullable(true). It throws me this error:"cannot explicitly call operator or accessor". Is there an alternative way ? Also, if there is a solution how I can I set the value is null

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      There is an object called DBNull. Use DBNull.Value when you need to use a null value in the database. set_IsNullable is the internal name of the setter part of the IsNullable property. Does this help? --Colin Mackay--

      EuroCPian Spring 2004 Get Together[^] "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

      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