批量插入,asp.net [英] Bulk insert, asp.net

查看:114
本文介绍了批量插入,asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有必要采取在对应于一个部件的ID号的列表。它们可以从10至10,000在任何特定时间正在处理的任何地方。我没有问题,收集数据,分析数据,并以数据表或任何(C#)加载它,但我想在数据库中做一些操作。什么是插入所有这些数据插入到表中的最佳方式?

I have a need to take in a list of ID numbers corresponding to a member. Their can be anywhere from 10 to 10,000 being processed at any given time. I have no problem collecting the data, parsing the data and loading it in to a DataTable or anything (C#) but I want to do some operations in the database. What is the best way to insert all of this data into a table?

我敢肯定,我不想跑为每个语句并插入10,000次。

I am pretty sure I don't want run a for each statement and insert 10,000 times.

推荐答案

我用的的SqlBulkCopy类做了几百万补充道。这似乎很方便。

I've used the SqlBulkCopy class before to do a couple million adds. It seemed pretty handy.

这篇关于批量插入,asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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