当我的电脑关闭时,Sql server关闭 [英] Sql server turns off when my pc turns off

查看:101
本文介绍了当我的电脑关闭时,Sql server关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我已将我的项目复制到另一台PC上。项目包括使用Sql Server上的数据库。当我的电脑开启时,该应用程序正常运行,但当我关闭电脑时,另一台电脑上的应用程序无法正常工作(出现错误)。这是错误:



Hi. I have copied my project on another PC. Project includes working with database that is on Sql Server. The app is working perfectly when my PC is turned on, but when I turn off my PC the app on another PC is not working (it comes up with an error). This is the error:

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.

(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326)





编辑:这是我的连接字符串:



This is my connection string:

Data Source=JOHN-PC\SQLEXPRESS;Initial Catalog=MyDatabase;Persist Security Info=True;User ID=MyUsername;Password=MyPassword





如果我将数据源更改为.\SQLEXPRESS,则会出现错误:





If I change Data Source to .\SQLEXPRESS the error comes up:

Login failed for MyUsername user.





我尝试了什么:



由于我是SQL Server的新手,最近我发现有一个新的SQL Server版本中称为AlwaysON的选项。这个选项和我的问题之间有什么联系吗?我怎样才能处理我的问题?



What I have tried:

Since I'm new in working with SQL Server, recently I found out that there is an option in new SQL Server versions that is called AlwaysON. Is there any connection between this option and my problem? And how can I deal with my problem?

推荐答案





这个问题可能是因为SQL Server服务。



Sql Server服务模式可能是 - 手动。你需要制作自动。



步骤:



运行 - >类型 - services.msc



查找 - SQL Server - 实例并将启动类型从手动更改为< b>自动



谢谢,

Parveen Siwach
Hi,

This issue may be because of SQL Server "Services".

The Sql Server service mode may be - "Manual". You need to make that "Automatic".

Steps:

Run -> type - services.msc

Find - SQL Server - Instance and change the Startup Type from Manual to Automatic

Thanks,
Parveen Siwach


这篇关于当我的电脑关闭时,Sql server关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆