none
Access Database is not saving the data RRS feed

  • Question

  • Hi Everyone,

    I'm facing an error while saving data to my Access Database,

    I've created a database and used it with VB.Net for an application. I changed some textfields to ComboBoxes and when i try to enter data in the gridview which is connected to database, filled all data successfully by clicking on save button. But, data is not being stored in Access Database. Why? What is being done wrong with the data that it is not storing in Database?

    Monday, June 10, 2019 2:20 PM

Answers

  • Hello,

    If using TableAdapter method to work with data then one of the common reasons for what is happening is that the database is copied to the Bin\Debug folder each time you run the project.

    Select the database in Solution Explorer, select properties, select Copy to Output folder. Set to "Copy if newer"

    If not using TableAdapter to work with data we need more details. For instance if using a DataAdapter the update method returns how many rows where affected, if using OleDb data provider then the Command ExecuteNonQuery will return rows affected.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by AHM3DRAXA Monday, June 10, 2019 7:29 PM
    Monday, June 10, 2019 2:43 PM
    Moderator

All replies

  • Please post the code you wrote.

    william xifaras

    Monday, June 10, 2019 2:38 PM
  • Hello,

    If using TableAdapter method to work with data then one of the common reasons for what is happening is that the database is copied to the Bin\Debug folder each time you run the project.

    Select the database in Solution Explorer, select properties, select Copy to Output folder. Set to "Copy if newer"

    If not using TableAdapter to work with data we need more details. For instance if using a DataAdapter the update method returns how many rows where affected, if using OleDb data provider then the Command ExecuteNonQuery will return rows affected.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by AHM3DRAXA Monday, June 10, 2019 7:29 PM
    Monday, June 10, 2019 2:43 PM
    Moderator
  • Thanks for a great help Miss Karen, I was using Table Adapter Method and it worked like charm. But for your other method to find text in DataGridView, i used the method you've posted. It worked and then i tried it displaying. I'll post a different question for it and will post link in here! 

    Thanks again for a great help! Appreciated.

    Monday, June 10, 2019 7:31 PM