Summary of. net c # Calling Sqlite,

Source: Internet
Author: User

Summary of. net c # Calling Sqlite,

-- Preface

Because you have too many passwords and it is hard to remember them, you will often forget them. So I want to find a management software to manage and worry about the possibility of online downloads. So I started to write my own password management software.

Because I have been doing WEB development, I do not know much about WPF. I have used WinForm to write software in college. But what about the database? At first I wanted to use MSSQL, but it was not convenient to copy and move it, and I had to install the MSQL software. Later, I thought of using SQLite, which makes it easy to copy and do not need to install any software. In addition, the Code management tool uses my own GitHub.

Because SQLite was used as a database for the first time, various inexplicable exceptions were reported. I checked some on the Internet, but some of them are completely different from what I encountered.

Development Environment: Win x64, VS2013 UP5

My project framework:

References between them are as follows:

The MyPasswordManage UI Layer references the following class libraries (BLL, Common, and Model)

PasswordManage. BLL business layer reference (Common, DAL, Model)

PasswordManage. DAL data layer reference (Common, Model)

For example, 64-bit sqlite-netfx45-binary-bundle-x64-2012-1.0.97.0.zip package was downloaded at the beginning, and System. Data. SQLite. dll was referenced at the DAL layer.

The following error can be reported during compilation:

 

After checking on the Internet, some people say that they want to change the Platform targetof the project that referenced the dll to x86 and use sqlite-netfx45-binary-bundle-win32-2012-1.0.97.0.zip to change the Platform to 32-bit.

 

But the problem still cannot be solved. At last, I wrote a Demo without hierarchy. I wrote the data read/write and business logic on the UI Layer, with a layer. In this way, no error is reported. Note the following when connecting to the Sqlite database:

We usually write this way.

The connection string is invalid. Later, I checked it and changed it to the following statement to read it.

 

The above is a summary of some of my problems.

I found that Sqlite cannot be layered and I don't know why. It's strange. If it is developed with Sqlite and can be layered, please share it with me! ^-^

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.