I have a Problem after I restive data from multiple result set I update the data and save it and its updated in Sql but when I retrieve it again its bring the old data what I can do?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You don't give many clues how you are doing this, and how you are doing the save (which might be important). However, a common gotcha here is using a local database file that is part of your project. If the project says "Copy Always", then every time you build it, the database is re-written from the unaltered state.
If that isn't the problem - are you perhaps leaving a transaction open?
(edit) Now that we've established that you are using LINQ-to-SQL; are you calling SubmitChanges()
? It would also help to know whether you are using a single data-context, multiple data-contexts, or what? A data-context will only track changes in objects it created.