Database Component Hxj. Data (24) (Sqlite database)

Source: Internet
Author: User

The Hxj. Data (V1.3) component adds support for the Sqlite database. Download the latest version

 

And the entity generation tool (V1.3) also released to support the entity generation of the Sqlite database.

 

To use Sqlite for database development, you must reference Hxj. Data, Hxj. Data. Sqlite, and System. Data. SQLite.

 

Config configuration database connection example:

<Add name = "SqliteConnectionString" connectionString = "Data Source = C: \ sqldb. db" providerName = "System. Data. SQLite"/>

 

Sample Code:

DbSession session = new Hxj. data. dbSession ("SqliteConnectionString"); using (Hxj. data. dbBatch batch = session. beginBatchConnection () {for (int I = 0; I <100; I ++) {test t = new test (); t. s = "test" + I. toString (); batch. insert <test> (t) ;}} GridView1.DataSource = session. from <test> (). toList (); GridView1.DataBind ();
 

In this way, 100 pieces of data are added in batches.

 

For other operations, see the previous sections.

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.