检索多个结果集 [英] Retrieve multiple results set

查看:73
本文介绍了检索多个结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从多个结果集中恢复数据后,我遇到了问题,我更新了数据并将其更新并保存在Sql中,但是当我再次检索到它带来的旧数据时,我能做什么?

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?

推荐答案

您不会提供很多线索,例如如何进行以及如何进行保存(这可能很重要).但是,这里常见的陷阱是使用本地数据库文件,该文件是项目的一部分.如果项目显示始终复制",则每次构建时,都会从未更改的状态重写数据库.

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?

(编辑)现在我们已经确定您正在使用LINQ-to-SQL;您在呼叫SubmitChanges()吗?知道您使用的是单个数据上下文,多个数据上下文还是什么,这也将有所帮助.数据上下文将仅跟踪其创建的对象中的更改.

(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.

这篇关于检索多个结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆