Overview
If you are running into a database connection error when starting up the POS we have some tips for resolving the issue.
Procedure
Common examples of the error messages you may see are:
"The application was unable to start correctly (0xc0000142). Click OK to close the application", the caption of the error message will say "sqlservr.exe - Application Error".
"System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible."
"Unexpected exception occurred: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. "
Solutions may include:
- Reboot the computer.
- Use the SQLLocalDB commands from command line to check on the status of the database server on the POS.
Run "sqllocaldb info" - this will show all running instances of SQL local DB. you should see an instance called "cr" in the list
Run "sqllocaldb info cr" and you should see information about that instance.-Shared name should be "shared"-Owner name should be your computer and your windows username-Auto-create should be "no"-State - this should be "Stopped" if Cloud Retailer isn't running and "Running" if it is.Instance pipe name should be empty if the instance is not running, and a path if it is.
Run "sqllocaldb start cr" to start the localdb instance.
You can find full documentation on the command line parameters here:https://docs.microsoft.com/en-us/sql/tools/sqllocaldb-utility - Use SQL management studio as a tool to diagnose issues. The connection string is "(localdb)\.\shared"
- Make sure the SQL Server VSS Writer service is running. If it was not, start it, and you may need to / should reboot the computer once more after this step before starting Cloud Retailer POS. SQL Server VSS Writer is not required strictly speaking but it can resolve connectivity issues on some occasions.
- Make sure the SQL Server Browser service is running.
References
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article