Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I get a very unusual problem in my winform application. Where I took database as MS-ACCESS database with extension .accdb and call that file into my winform application.

Later I find that I forgot to add one column too and later I add one column into my table in the same database namely "Terms" (without quotes) with datatype as Memo

Then after I run my application with the calling of same column inside one of my winform page.

What I found that that column does not exists error inside my winform application.

When I again open my same database, then what I found is that the column name "Terms" removed from my the table Name. I don't know how it is happened and what is the solution.

I even make the same database again and deleting the earlier one but still get the same issue.....

Can anyone suffering from the same unusual problem. If yes, what I've to do to solve this problem.....


Thanks A Lot In Advance
Posted
Comments
CHill60 31-Mar-15 8:49am    
Where are you storing the database? This sounds as if your database is being relocated into your virtual store and that you are looking at a different version
binadi007 31-Mar-15 21:35pm    
In Bin folder i saved the database file namely databaseName.accdb
Joan Magnet 31-Mar-15 9:03am    
Are you using a visual studio generated Dataset?
binadi007 31-Mar-15 21:36pm    
yes I'm but dataset is not used at the time of data entry. the column removed from table itself at the time of data entry

1 solution

If you modified the version of the Access database found under your projects bin\Release or bin\Debug folders you modified the wrong copy.

You have your database in the project folder above the bin folder. It's part of your project as a Content item. Every time you compile the app, all content is copied to the bin folder, OVERWRITING the database file that was there. That means any change you made to the database under one of the bin folders is lost the next time you compile and run the app in Visual Studio.
 
Share this answer
 
Comments
binadi007 31-Mar-15 21:37pm    
I've a copy of same database file on my bin folder and the folder where all the bin directory available.

So I remove the database file where the bin folder is available, and run the application fine.(I checked twice).
Does it solve my problem permanently or still will I face the problem in future?
Dave Kreskowiak 31-Mar-15 22:00pm    
Again, every time you run the application from inside Visual Studio, the Access database file in the bin folders is going to get overwritten by the copy in the root of your project. Any database changes you made in the bin version of the database will be OVERWRITTEN by the newly copied database file.

I don't know how I can make this any clearer.
binadi007 31-Mar-15 22:12pm    
If I have no database in the root of my project where my bin,obj,resources folder presents but I place the database in Bin folder then too it works fine.......is It ok or it'a bad way
Dave Kreskowiak 31-Mar-15 22:39pm    
In my opinion, using Access is a bad idea. I prefer SQL Server Express or LocalDb, or better yet, a full SQL Server, depending on the requirements.

binadi007 31-Mar-15 22:47pm    
You solved my problem.....+5 from my side......Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900