What is wrong with sql lite connection string?

very new to sql lite,

I want to use it for a small project, get some overview and try to implement, but I got an error when using the following connection string?

Can someone tell me what is wrong and what changes do I need to make when I set the path from web.config for the sql lite connection string.

SQLiteConnection connection = new SQLiteConnection("D:\\Projects\\Apica MVC\\wizardDemo\\Apica.Signupweb.Presentation.MvcWeb\\App_Data\\SignUpWebDB"); 

I got an error .......

"Invalid ConnectionString format for" D: \ Projects \ Apica MVC \ wizardDemo \ Apica.Signupweb.Presentation.MvcWeb \ App_Data \ SignUpWebDB "" "

No password has been set for the string.

+6
source share
1 answer

The connection string is not formatted correctly.

You specify the full path and file name of the database, but you need to make sure that you include part of the Data source= string in the connection string before the actual database path and file name (also note the half-line at the end of the connection string before the closing quote).

For instance:

 SQLiteConnection connection = new SQLiteConnection("Data Source=D:\\Projects\\Apica MVC\\wizardDemo\\Apica.Signupweb.Presentation.MvcWeb\\App_Data\\SignUpWebDB;"); 

You can specify more parameters in the SQLite Connection line, see this link in the old System.Data.SQLite forums for more information. Full documentation for the System.Data.SQLite package can be found on this page . The source file (among others) contains the SQLite.NET.chm documentation file.

+11
source

Source: https://habr.com/ru/post/906740/


All Articles