Home > Net >  C # for the installation of Windows services, unable to create a sqlite database
C # for the installation of Windows services, unable to create a sqlite database

Time:09-22

As title,
Directly in the console, sqlite can be created and operate,
Service control configuration of users, is set to the users of the system:


What's the solution?
Thank you very much,

CodePudding user response:

 
///& lt; summary>
///connect to the database
///& lt;/summary>
Public void OpenDB (string connectionString)
{
String ms1="db. 1... ";
Try
{
Ms1 +="2.. ";
DbConnection=new SQLiteConnection (@ "data source=" + the connectionString);
Ms1 +="3.. ";
DbConnection. The Open ();
Ms1 +="4.. ";
}
The catch (Exception e)
{
Ms1 +="5.. ";
//throw new SQLiteException (e. oString () + ms1);
}
}

Windows service invocation, there will be abnormal,
The console in the normal project calls, OK,
  • Related