Retrieve multiple results set

2019-09-21 17:12发布

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条回答
不美不萌又怎样
2楼-- · 2019-09-21 17:59

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.

查看更多
登录 后发表回答