SQLite batch database insertion Problems

Source: Internet
Author: User

I am using the datalogic memor scanner (Intel XScale PXA255 @ 200 MHz, 64 MB system memory, and system flash memory)
128 M), the operating system is WinCE
5.0. The database is sqlite3. Can I read a TXT file containing 0.2 million rows of data and write it to the SQLite database in the. NET environment?

My current practice is: Read the file content line by line, split the data as a parameter, and use DC. parameters. the add () method is added to the insert Statement of sqlitecommand. When all files are read and committed using a transaction, the fastest speed is more than 7 minutes. Which of the following experts has a more efficient way, can it be completed within 5 minutes?
My code is as follows:
Sqlitecommand Dc = ss. createcommand ();

DC. commandtext = "insert into tests values (?,?,?,?) ";
Sqliteparameter dp1 = Dc. createparameter ();
Sqliteparameter dp2 = Dc. createparameter ();
Sqliteparameter dp3 = Dc. createparameter ();
Sqliteparameter dp4 = Dc. createparameter ();

DC. Parameters. Add (dp1 );
DC. Parameters. Add (dp2 );
DC. Parameters. Add (dp3 );
DC. Parameters. Add (dp4 );

Filestream FS = file. openread (File );
Streamreader sr = new streamreader (FS );
This. lfinishtime. Text = datetime. Now. tostring ();
S = Sr. Readline ();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.