与 SQL Server 建立连接时发生网络相关或特定于实例的错误

发布于 2024-10-13 10:52:57 字数 992 浏览 3 评论 0原文

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

当我在网络服务器上上传我的网站并使用连接字符串与远程 sqlserver2005 连接时......

<connectionStrings>
    <remove name="ConnectionString"/>
    <add name="ConnectionString" connectionString="Data Source=69.16.253.19,1433;Initial Catalog=vb_usa;Persist Security Info=True;User ID=username;Password=password" providerName="System.Data.SqlClient"/>
  </connectionStrings>

它会产生以下错误 - 您可以在我的网页中看到错误:

它在上面显示错误..

http://vbi.volvobusesindia.com 在我的网站 APP_Data 文件夹中使用 aspnetdb.mdf...我在网站中使用的功能是登录控制、密码恢复、注册控制...

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

when i upload my site on webserver and connect with remote sqlserver2005 using connection string....

<connectionStrings>
    <remove name="ConnectionString"/>
    <add name="ConnectionString" connectionString="Data Source=69.16.253.19,1433;Initial Catalog=vb_usa;Persist Security Info=True;User ID=username;Password=password" providerName="System.Data.SqlClient"/>
  </connectionStrings>

it produces the following errr --
you can see error in my webpage :

http://vbi.volvobusesindia.com

it shows an error above ..

i m using aspnetdb.mdf in my website in APP_Data Folder... features i use in my website is Login Control, Password recovery, signup control...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦幻的心爱 2024-10-20 10:52:57

尝试了以上所有方法,但对我不起作用。当我检查服务时,我发现设置为自动的SQLExpress服务没有启动。一旦我启动 SQLExpress 服务,一切就正常了。

Tried all the above but did not work for me. When I checked Services, I found that the SQLExpress service which was set Automatic, was not started. Once I started the SQLExpress service, everything worked.

呆头 2024-10-20 10:52:57

请参阅此站点中的指南 http://www.connectionstrings.com/sql-server-2005

特别请查看该页面上标题为“在连接到本地 SQL Server Express 实例时附加位于数据目录中的数据库文件”的部分。

格式为:

服务器=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;
数据库=数据库名称;Trusted_Connection=是;

基本上,您需要连接到安装在 Web 服务器上的 SQL Express 实例并将其指向数据库文件所在的位置。

See the guide in this site http://www.connectionstrings.com/sql-server-2005

In particular look at the section on that page titled "Attach a database file, located in the data directory, on connect to a local SQL Server Express instance"

The format is:

Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;
Database=dbname;Trusted_Connection=Yes;

Basically, you need to connect to the SQL Express instance installed on the web server and point it to where your database file is located.

孤蝉 2024-10-20 10:52:57

在该远程计算机 (63.15.223.19) 上,SQL 服务未运行。您可以转到该计算机并尝试从命令提示符运行“net start mssqlserver”。

On that remote machine (63.15.223.19), the SQL services are not running. You can go to that machine and try to run "net start mssqlserver" from command prompt.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文