You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
No sure if anyone else is having this problem but i can't seems to save to the sql sqldatabase when i use the tableadapter.insert & update it is display to the datagridview but once i close the whole program and open the sql database the data is gone.... anyone can help?
Yeah, it doesn't work for me either, and the code is 100% correct. I've show it to experts and the code works on other peoples machines. I'm not sure why, but on some peoples machines, it simply doesn't work.
When you run / debug an application the database is by default copied to the output directory. Any data updated by your application is updated in that copy of the .mdf file. When you exit the application and go back to the project window you are working with the original database, prior to edits by your program. The next time you run the program, the database is again over-written as part of the compile process.
I just read this topic recently and it's one of the problems I am facing as a new .Net programmer. So what is the solution to this? How can the changes in the copy of the .mdf directory be transmitted to the original database in real time such that the inserted data at runtime can be seen in the tables after debugging? In fact I am experiencing this problem only with the windows application. The database works just fine with my ASP.Net Applicaition