问:复制DataTable [英] Q: Copying a DataTable

查看:74
本文介绍了问:复制DataTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个包含数千行的DataTable。我想快速将

行插入到具有相同结构的Access数据库的表中。我用

使用更新命令,但发现它非常慢,即有大约

100,000行数据。


任何人都可以建议一个快速的方法吗?


Geoff

Hi

I have a DataTable with thousands of rows. I want a quick way to insert the
rows into a table in an Access database with the same structure. I have been
using an update command but found it to be very slow i.e. there are about
100,000 rows of data.

Can anybody suggest a quick way to do it?

Geoff

推荐答案

" Geoff" <无******** @ email.com>在留言中写道

news:43 *********************** @ news.dial.pipex.com ...
"Geoff" <no********@email.com> wrote in message
news:43***********************@news.dial.pipex.com ...
我有一个包含数千行的DataTable。我想快速地将行插入具有相同结构的Access数据库中的表中。
.. 。大约有100,000行数据
I have a DataTable with thousands of rows. I want a quick way to
insert the rows into a table in an Access database with the same
structure. .. . . there are about 100,000 rows of data




就个人而言,我会将其转储到合适的平面文件中并使用

" ;批量装载实用而不是试图自己写。


IIRC,Access使用类似获取外部数据的内容。 ...


HTH,

Phill W.



Personally, I''d dump it out into a suitable, flat file and use a
"bulk load" utility rather than trying to write it myself.

IIRC, Access uses something like "get external data" ...

HTH,
Phill W.


Geoff,


如果你想用一个程序来做这个,因为它不是一次性的方法

(否则Phil建议的方式对我来说也是如此),对于datadader和Inserts,我不会使用
而不是数据适配器。


(如果访问表离线,那么xml数据集和你的方法

当然是你的朋友。)


我希望这会有所帮助,


Cor


" Geoff" <无******** @ email.com> schreef in bericht

news:43 *********************** @ news.dial.pipex.com ...
Geoff,

If you want to do it using a program because it is not a one time approach
(otherwise the way Phil suggest is for me as well the one to go), than I
would not go for the dataadapter however for a datareader and Inserts.

(If the access table is off line than can the xml dataset and your approach
of course be your friend).

I hope this helps,

Cor

"Geoff" <no********@email.com> schreef in bericht
news:43***********************@news.dial.pipex.com ...


我有一个包含数千行的DataTable。我想快速将行插入具有相同结构的Access数据库中的表中。我一直在使用更新命令,但发现它非常慢,即大约有100,000行数据。

任何人都可以建议一个快速的方法吗? br />
杰夫
Hi

I have a DataTable with thousands of rows. I want a quick way to insert
the rows into a table in an Access database with the same structure. I
have been using an update command but found it to be very slow i.e. there
are about 100,000 rows of data.

Can anybody suggest a quick way to do it?

Geoff



你好Cor


我怕我不喜欢跟随。你是什​​么意思不是为了数据适配器

然而对于数据加载器而言是插入物?


访问表是脱机的,即在应用程序运行的计算机是
。我对你提到的xml数据集很感兴趣。你能给一个代码

例子吗?


提前谢谢


Geoff

" Cor Ligthert [MVP]" <无************ @ planet.nl>在消息中写道

news:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
Hi Cor

I''m afraid I don''t follow. What do you mean by "not go for the dataadapter
however for a datareader and Inserts"?

The access table is off-line i.e. on the computer that the application is
running. I''m intrigued by the xml dataset you mention. Could you give a code
example?

Thanks in advance

Geoff

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Geoff,

如果你想使用一个程序,因为它不是一次性的方法
(否则Phil建议的方式对我来说也是这样),比我然而,对于数据加载器和插入,不会使用dataadapter。

(如果访问表离线,那么xml数据集和你的
方法当然是你的朋友)。

我希望这会有所帮助,

  Geoff" <无******** @ email.com> schreef in bericht
新闻:43 *********************** @ news.dial.pipex.com ...
Geoff,

If you want to do it using a program because it is not a one time approach
(otherwise the way Phil suggest is for me as well the one to go), than I
would not go for the dataadapter however for a datareader and Inserts.

(If the access table is off line than can the xml dataset and your
approach of course be your friend).

I hope this helps,

Cor

"Geoff" <no********@email.com> schreef in bericht
news:43***********************@news.dial.pipex.com ...


我有一个包含数千行的DataTable。我想快速将行插入具有相同结构的Access数据库中的表中。我一直在使用更新命令,但发现它非常慢,即大约有100,000行数据。

任何人都可以建议一个快速的方法吗? br />
杰夫
Hi

I have a DataTable with thousands of rows. I want a quick way to insert
the rows into a table in an Access database with the same structure. I
have been using an update command but found it to be very slow i.e. there
are about 100,000 rows of data.

Can anybody suggest a quick way to do it?

Geoff




这篇关于问:复制DataTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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