如何在Sql Server 2008中一次从网格视图中插入一万行和更多行 [英] How to Insert Ten Thousand Rows And More Rows from a Grid View in a Sql Server 2008 at a time

查看:115
本文介绍了如何在Sql Server 2008中一次从网格视图中插入一万行和更多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Sql Server 2008中一次从网格视图插入一万行和更多行

How to Insert Ten Thousand Rows And More Rows from a Grid View in a Sql Server 2008 at a time

推荐答案

这是一个非常糟糕的设计,我会说。



首先,为什么你在UI上显示这么多行?没有人想立刻看到这么多的记录。



接下来的事情是,插入有多少行并不重要。您只需循环遍历行并逐个插入即可。否则,您可以使用 SqlBulkCopy 一次插入批量数据。请参阅 - 使用SqlBulkCopy插入从GridView到ASP.Net中的数据库的批量数据 [ ^ ]。
This is a very bad design, I would say.

First of all why are you showing this much of rows on UI? No one wants to see this much of records at once.

Next thing is, it does not really matter how many rows are there to insert. You just need to loop through the rows and insert one by one. Else, you can use SqlBulkCopy to Insert Bulk data at once. Refer - Using SqlBulkCopy to insert bulk data from GridView to database in ASP.Net[^].


这篇关于如何在Sql Server 2008中一次从网格视图中插入一万行和更多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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