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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. My database gets cleared upon my application startup

My database gets cleared upon my application startup

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasehelp
4 Posts 4 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.
  • K Offline
    K Offline
    Kofi Ambrose
    wrote on last edited by
    #1

    I am building an application in VB.Net and i am using ms access database. The problem is that when i insert data into the database, it goes alright but upon running the program again, the database loses all its data. I went to the dataset code and saw this property "ClearBeforeFill" been set to true and i changed it to false yet the problem persists. Can somebody come to my aid.

    E T D 3 Replies Last reply
    0
    • K Kofi Ambrose

      I am building an application in VB.Net and i am using ms access database. The problem is that when i insert data into the database, it goes alright but upon running the program again, the database loses all its data. I went to the dataset code and saw this property "ClearBeforeFill" been set to true and i changed it to false yet the problem persists. Can somebody come to my aid.

      E Offline
      E Offline
      Eslam Afifi
      wrote on last edited by
      #2

      ClearBeforeFill indicates the Fill method shall clear the dataset before filling it. It has nothing to do to with the database. I guess your problem is one of the following: - You don't call the Update method. - Your database gets overwritten every build. This is determined by the "Copy to Output Directory" property of the database file (select the file from the Solution Explorer, you'll find this property in the Properties Window). And let me know if this solves your problem.

      Eslam Afifi

      1 Reply Last reply
      0
      • K Kofi Ambrose

        I am building an application in VB.Net and i am using ms access database. The problem is that when i insert data into the database, it goes alright but upon running the program again, the database loses all its data. I went to the dataset code and saw this property "ClearBeforeFill" been set to true and i changed it to false yet the problem persists. Can somebody come to my aid.

        T Offline
        T Offline
        Tom Deketelaere
        wrote on last edited by
        #3

        are you using Vista? it could be a problem with the rights (virtualization and such)

        1 Reply Last reply
        0
        • K Kofi Ambrose

          I am building an application in VB.Net and i am using ms access database. The problem is that when i insert data into the database, it goes alright but upon running the program again, the database loses all its data. I went to the dataset code and saw this property "ClearBeforeFill" been set to true and i changed it to false yet the problem persists. Can somebody come to my aid.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Is your .MDB file part of the project?? Click on the file and check the Properties window. Does the "Copy to Output Directory" option say "Copy always"?? Change this to "Copy if newer". The database in the bin\Debug folder is getting overwritten with the original copy of the .MDB file in your project folder, thereby overwriting any changes your code makes to the Debug copy of the database.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          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