Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Hi...
I created an access database and now I want to add some data into it using C# but when I close my app,my data gone!

Now How can I stanch my data into database using C#!!!

for example I have some name like: Name:
-----
kirk
mohsen
john

now I want add the name "Amir" into name in database and I want to look it into my field...

help me!

thanks...
Posted
Updated 18-Sep-12 5:17am
v3
Comments
Kschuler 18-Sep-12 10:33am    
Post the code you are using to add the data and we can help you find any problems in the code. Also, what kind of project is this for? Website, Windows Forms, etc? How do you connect to the database?
amir.nazarizadeh 18-Sep-12 10:55am    
excuse me!
it's windows form and I want code for add my new data into database!
Killzone DeathMan 18-Sep-12 10:35am    
One day I have the same problem...
Right click on the database -> Properties and there is about three options like:
"Copy Always"
"Copy if newer"
"Not Copy"
Something like that, and you put: "Copy if newer"!
Regards,
KZ
Kschuler 18-Sep-12 10:52am    
You should post this as a possible solution, instead of just a comment.
Killzone DeathMan 18-Sep-12 16:56pm    
I dont care about the reputation points in this site, I only care about programming experience...
Have a nice day!
KZ

1 solution

Where do you have your database: in the project folder?
If yes, move your database in to another folder.

BTW: Name is a reserved word in MS Access. Never use it as the name of column.

More about reserved words at:
http://support.microsoft.com/kb/286335[^]
http://office.microsoft.com/en-us/access-help/access-2007-reserved-words-and-symbols-HA010030643.aspx[^]
 
Share this answer
 
Comments
Sandeep Mewara 18-Sep-12 12:09pm    
Yep. My 5!
Maciej Los 18-Sep-12 12:12pm    
Thank you, Sandeep ;)
amir.nazarizadeh 18-Sep-12 13:41pm    
no no,,,"name" is an example,I didn't use it!
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