Copying large amounts of data into a SQL CE database

拜拜、爱过 提交于 2019-12-06 13:25:51

The first thing that popped into my head was to do a sync/merge with a desktop or server database, though that doesn't sound like it really fits your needs. So here is my second thought:

BULK INSERT table_name FROM data_file

I am not sure if it is supported in your version of SQL CE (though it appears to be supported in 3.5 SP1 from what I can tell on the MSDN pages). http://msdn.microsoft.com/en-us/library/ms188365.aspx

You could also disable any indexes on the table while inserting the data to speed things up, then enable/rebuild the index once you are done inserting.

Steve Lasker has a great code sample demoing this with different methods, but the best method (by far) is SqlCeResultSet.

Here is a blog post from Steve with some good powerpoints on this subject.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!