How to Use Sqlite database in Asp.net

Source: Internet
Author: User

Sqlite is a popular database recently. It is more efficient and fast than Access and is easy to implement. No configuration is required on the client. You only need to reference the DLL file in the site.

In practical use, when I use SqliteAdmin and SQLite Expert Professional 2 to create an Sqlite database, it cannot be used in ASP. NET. The error is always reported: The file is not a legal database. Later, we used a method to create a database using the referenced DLL in ASP. NET.

String datasource = "d :\\ test. db"; // address of the database file

System. Data. SQLite. SQLiteConnection. CreateFile (datasource); // generate a file

In this way, the test. db can be used in asp.net. In this case, you can use SqliteAdmin and SQLite Expert Professional 2 software to open it and create tables in it without affecting its use.

The operations on Sqlite are actually very similar to those on Access, except that all operations starting with OleDB have become SQLite.

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.