SqlDataAdapter.Update(),有关方法及其如何修改数据库的详细信息 [英] SqlDataAdapter.Update(), details about the method and how it modifies the database

查看:175
本文介绍了SqlDataAdapter.Update(),有关方法及其如何修改数据库的详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于SqlDataAdapter方法(SqlDataAdapter.Update(dataset,srcTable)),当它被调用时,该方法会获取数据集对象中的所有记录并将它们重写到数据库中,或者只接受已更改的记录。

我问,因为我正在编写一个程序,它将通过一个网络访问数据库,每个表中有多个用户和数千条记录,所以我需要尽量减少流量。



注意:我正在使用与适配器同步的SqlCommandBuilder对象来生成SQL字符串命令(例如:GetInsertCommand(true))

About the SqlDataAdapter method (SqlDataAdapter.Update(dataset, srcTable)), when it is called does the method take all the records in the dataset object and rewrite them to the database or does it only take the records that have been changed.
I ask because I am writing a program that will access the database over a network with multiple users and thousands of records in each table so I need to minimize the traffic as much as possible.

Note: I am using the SqlCommandBuilder object synced with the adapter to generate the SQL string commands (ex: GetInsertCommand(true))

推荐答案

阅读此链接验证了我认为是真实的,只有更改的行才会更新到数据库。



http://msdn.microsoft.com/en-us/library/ a19c81fk(v = vs.110).aspx [ ^ ]
reading this link validates what I believed to be true, that only the changed rows are updated to the database.

http://msdn.microsoft.com/en-us/library/a19c81fk(v=vs.110).aspx[^]


这篇关于SqlDataAdapter.Update(),有关方法及其如何修改数据库的详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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