Home > Net >  C # Windows service access to a Shared out the sqlite database
C # Windows service access to a Shared out the sqlite database

Time:09-23

C # Windows service launched after the connection is not Shared out the sqlite database, prompt found no database,,, no problem but the console program, this is the service access problem?

CodePudding user response:

His top a, hope ace to solve the problem,

CodePudding user response:

Irrelevant, but,
Using SQLite files on a network share, very may cause data disaster in the future,

CodePudding user response:

Your service program and the console on the same machine? Sqlite database does not support multiple users to share, speaking, reading and writing, it's just a local database of the embedded application,

CodePudding user response:

The
reference 3 floor datafansbj response:
your service program and the console program on the same machine? Sqlite database does not support multiple users to share, speaking, reading and writing, it's just a embedded in application to the local database,

Why, yes, on the same computer, but can the console program, service is not,,, that I don't understand, is a service to set up what?

CodePudding user response:

refer to the second floor github_36000833 response:
irrelevant, however,
Using SQLite files on a network share, very may cause data disaster in the future,

Truth is such a truth, but the reality is always so disappointing,,, read only, do not write,,, so should the disaster is not big, the key is how to solve the problem?

CodePudding user response:

Prompt didn't find the database, and, out of the tip, that's what you put in the right path, rather than a permissions issue, if it is permission problems, how is such a hint?

CodePudding user response:

refer to 6th floor ying1234 response:
prompt didn't find the database, and, out of the tip, that's what you put in the right path, rather than a permissions issue, if it is a permission problem, how is such a hint?

Perfect run path put wrong, how to explain the console program? And the service is at the wrong? This path is other server Shared folder (if)

CodePudding user response:

Debug your service program interrupt carefully look into the path

CodePudding user response:

refer to 7th floor White_98K response:
Quote: refer to the sixth floor ying1234 response:

Prompt didn't find the database, and, out of the tip, that's what you put in the right path, rather than a permissions issue, if it is permission problems, how is such a hint?

Perfect run path put wrong, how to explain the console program? And the service is at the wrong? This path is other server Shared folder (premise)


You see a network share is currently logged in user's network sharing, service program generally run under the System account, different from the currently logged in user interaction,
The current user to run the console, you can use the current user's network sharing, is not equal to the System account will be able to use the network share,

CodePudding user response:


You said wrong path, tell me, I this path where wrong, want how to write,,, one is the other servers to share, I opened this function normal, one is my path configuration, the same path, the console can run, but is installed as a service error, such is the case,

CodePudding user response:

references 9 f github_36000833 response:
Quote: refer to 7th floor White_98K response:

Quote: refer to the sixth floor ying1234 response:

Prompt didn't find the database, and, out of the tip, that's what you put in the right path, rather than a permissions issue, if it is permission problems, how is such a hint?

Perfect run path put wrong, how to explain the console program? And the service is at the wrong? This path is other server Shared folder (premise)


You see a network share is currently logged in user's network sharing, service program generally run under the System account, different from the currently logged in user interaction,
The current user to run the console, you can use the current user's network sharing, is not equal to the System account will be able to use the network sharing,

Service properties, set the current administrator login, is still the same wrong,,, alas,,,

CodePudding user response:

The
references to the tenth floor White_98K response:

You said wrong path, tell me, I this path where wrong, want how to write,,, one is the other servers to share, I opened this function normal, one is my path configuration, the same path, the console can run, but is installed as a service error, such is the case, the


So, is a question of authority,
https://www.jianshu.com/p/8417cea3a122
This article you see, there is help,

CodePudding user response:

The
refer to 12 floor ying1234 reply:
Quote: reference to the tenth floor White_98K response:


You said wrong path, tell me, I this path where wrong, want how to write,,, one is the other servers to share, I opened this function normal, one is my path configuration, the same path, the console can run, but is installed as a service error, such is the case, the


So, is a question of authority,
https://www.jianshu.com/p/8417cea3a122
This article you see, there is help,

Thank you, first take a look at the article,

CodePudding user response:

Don't recommend this design, a Windows service running in the system account, is not the same with your desktop login account, you can access the network file using the Shared way, just say you can use the current desktop account access, do not represent the system account to access, service is can run automatically after system start (don't need to log in to the desktop), unlike desktop application must login to run (the console command line belong to the desktop applications),

CodePudding user response:

On the 14th floor datafansbj
reference response:
don't recommend this design, a Windows service running in the system account, is not the same with your desktop login account, you can access the network file using the Shared way, just say you can use the current desktop account access, do not represent the system account to access, service is can run automatically after system start (don't need to log in to the desktop), unlike desktop application must login to run (the console command line belong to the desktop applications),

According to this train of thought, you just need to set the current user to access to go, right,

CodePudding user response:

Don't recommend to do this, will produce a lot of problems, login service before the desktop, network connection at this time has not yet been established, not be able to access other files on the network, you must manually login to the desktop, and then start the service must be started as a desktop account (services), balabala...
Why must use the service? Can't use desktop application?

CodePudding user response:

reference 16 floor datafansbj response:
is not recommended to do this, will produce a lot of problems, login service before the desktop, network connection at this time has not yet been established, not be able to access other files on the network, the need to manually login to the desktop, and then start the service must be started as a desktop account (services), balabala...
Why must use the service? Can't use desktop application?

Be afraid someone accidentally turn off the program, so consider using the service?nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C #
  • Related