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. Updating a boolean field in Access - How?

Updating a boolean field in Access - How?

Scheduled Pinned Locked Moved ASP.NET
questiondatabaseannouncement
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.
  • I Offline
    I Offline
    israeli
    wrote on last edited by
    #1

    Hi, I have a table within Access DB where all the fields are of text type. Recently I added a new column of boolean (Yes/No) type. The question is how can I update this column ? For the text fields I used the following: int ID = Convert.ToInt32(e.Item.Cells[0].Text); string name_en = ((TextBox)e.Item.Cells[2].Controls[0]).Text; string sql ="UPDATE TableElectric SET NameEn=\"" + name_en+ "\"" + " WHERE ID=" + ID.ToString(); ExecuteNonQuery(sql); What different code should I use for the updating of the boolean (Yes/No) field in my DB ? Thanks.

    A 1 Reply Last reply
    0
    • I israeli

      Hi, I have a table within Access DB where all the fields are of text type. Recently I added a new column of boolean (Yes/No) type. The question is how can I update this column ? For the text fields I used the following: int ID = Convert.ToInt32(e.Item.Cells[0].Text); string name_en = ((TextBox)e.Item.Cells[2].Controls[0]).Text; string sql ="UPDATE TableElectric SET NameEn=\"" + name_en+ "\"" + " WHERE ID=" + ID.ToString(); ExecuteNonQuery(sql); What different code should I use for the updating of the boolean (Yes/No) field in my DB ? Thanks.

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      hi, Use 0/1 to update the boolean field

      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