首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >尝试使用IPAddress连接远程SQL Server的Web配置

尝试使用IPAddress连接远程SQL Server的Web配置
EN

Stack Overflow用户
提问于 2015-05-29 22:47:26
回答 2查看 218关注 0票数 0

我正在尝试使用web.config连接字符串连接远程SQL

我得到下面的错误,不确定我做错了什么,尝试了所有选项,如TCP 1433等。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
The network path was not found 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.ComponentModel.Win32Exception: The network path was not found

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[Win32Exception (0x80004005): The network path was not found]

[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. 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)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5352431
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +5363103
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +145
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +891
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +307
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) +518
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +278
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +732
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +85
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1057
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
   System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +196
   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +146
   System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +16
   System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +94
   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +110
   System.Data.SqlClient.SqlConnection.Open() +96
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +88
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +239
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +819
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +88
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +106
   System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +59
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +113
   System.Web.UI.WebControls.Login.AttemptLogin() +119
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +75
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +159
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

上面是我得到的跟踪错误

我启用了所有TCP、共享管道和内存

谢谢

EN

回答 2

Stack Overflow用户

发布于 2015-05-30 00:35:16

这看起来像是连接问题,你需要知道问题出在哪一层,首先验证你的连接字符串,然后遵循下面的指导原则:

  • Ping本地主机。
  • Ping远程服务器或同一网络中的其他主机。
  • Ping远程服务器。
  • 验证防火墙配置(本地和远程)。
  • ,最后尝试使用远程客户端连接。
票数 1
EN

Stack Overflow用户

发布于 2015-05-30 06:45:48

在编写代码之前,我建议您手动检查是否可以使用server management studio连接远程服务器。

如果在查找路径时有任何问题:

检查配置管理器中的SQL服务是否正在运行(如TCP/IP)

检查远程连接后,您可以检查防火墙入站出站规则。(如果网络安全,您可以尝试仅禁用防火墙进行检查)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30540200

复制
相关文章
python json转字符串_在python中将json转换为字符串
一开始我没有清楚地解释我的问题。在python中将json转换为字符串时,请尝试使用str()和json.dumps()。
全栈程序员站长
2022/11/16
10.3K0
在 Python 中将一个 Legendre 系列添加到另一个 Legendre 系列
要将一个 Legendre 系列添加到另一个系列,请使用 Python 中的 polynomial.legendre.legadd() 方法 嘟嘟。该方法返回一个数组,表示其总和的勒让德系列。
很酷的站长
2023/02/23
5520
在 Python 中将一个 Legendre 系列添加到另一个 Legendre 系列
常用的JVM参数选项
栈 -Xss128k <==> -XX:ThreadStackSize=128k 设置线程栈的大小为128K
一个风轻云淡
2023/10/15
3430
常用的JVM参数选项
linux常用命令之文件管理默认情况选项参数注意用法选项用法选项用法参数注意用法选项用法选项注意用法选项注意
LS ls:list directory contents 默认情况 默认情况下显示的是mtime 选项 -a 列出全部文件及目录包括隐藏的 -l 列出详细信息,包括文件类型、权限、节点、owner、group、size(b)、修改日期、文件名 -d 列出目录本身,且不列出目录下的内容 -h size用易读的单位 表示,如kg -F 列出文件类型-S按大小从大到小排序 -t  按更新时间从新到旧排序 -r 以相反的顺序排序 -i 显示inode号码 –time=atime 显示访问时间 –time=ct
用户1174983
2018/02/05
2.6K0
jQuery 选项卡插件 FengTab by FungLeo
好无聊啊,权当练手,写了一个选项卡插件 Html 结构 <h2>Demo 1</h2> <div id="FengTab" class="FengTab"> <ul class="tab"> <li>Title 1</li> <li>Title 2</li> <li>Title 3</li> <li>Title 4</li> </ul> <div c
FungLeo
2022/11/28
1.3K0
jquery nicescroll 配置参数
jQuery滚动条插件兼容ie6+、手机、ipad http://www.areaaperta.com/nicescroll/ jQuery(function($){ $("#scrollInner").niceScroll({ touchbehavior:false, cursorcolor:"#398F70", cursoropacitymax:1, cursorwidth:5, cursorborder:
deepcc
2018/05/16
4.1K0
删除所选项(附加搜索部分的jquery)
1.视图端(views)的配置为: <script> $(document).ready(function() { $("#info-grid").kendoGrid({ dataSource: { type: "json",
wfaceboss
2019/04/08
9370
jquery ajax参数详解
type:boolean (默认: true) 默认设置下,所有请求均为异步请求。如果需要发送同步请求,请将此选项设置为 false。注意,同步请求将锁住浏览器,用户其它操作必须等待请求完成才可以执行。
别团等shy哥发育
2023/02/25
2.5K0
python中将字符串转为json对象并
string =" {   "status": "error",   "messages": ["Could not find resource or operation 'BZK1.MapServer' on the system."],   "code": 404
py3study
2020/01/09
1.2K0
Shell脚本的参数和选项
Shell脚本是一种常用的自动化工具,用于编写各种任务和批处理脚本。Shell脚本支持参数和选项,可以让我们更灵活地控制脚本的行为。本文将详细介绍Shell脚本中的参数和选项,包括基本语法、使用方法和示例。
玖叁叁
2023/04/10
2.4K0
python中将 \\uxxxx转换为 Unicode字符串
今天碰到一个很有意思的问题,需要将普通的 Unicode字符串转换为 Unicode编码的字符串,如下:
渔父歌
2018/09/26
2.3K0
在Java中将ArrayList转换为Array
In this tutorial you will learn how to convert ArrayList to Array in Java.
用户7886150
2021/04/29
1.7K0
如何在Python中将列表转换为字符串?
Python provides different variable type for programmers usage. We can use int, float, string, list, set … data types in our applications. While using different type of variables we may need to convert then to different types. In this tutorial we will different type of conversion from list to string in Python.
全栈程序员站长
2022/08/12
4.5K0
如何在 Linux 中将目录添加到 PATH 变量,方便执行自定义命令
在开始之前,让我们先了解一下 PATH 变量的基本概念。PATH 变量是一个由冒号分隔的目录列表,系统将按照这个列表的顺序搜索可执行文件。当我们在终端输入一个命令时,系统会按照 PATH 变量中的目录顺序逐个搜索,直到找到与命令名称匹配的可执行文件或者搜索完所有的目录。
网络技术联盟站
2023/09/06
2.7K0
如何在 Linux 中将目录添加到 PATH 变量,方便执行自定义命令
jquery中ajax参数详解
title: $.ajax参数详解 date: 2017-04-08 15:25:57 tags: ajax categories: ajax
念念不忘
2019/03/29
2.1K0
如何在 Bash 中将字符串计算为数字?
当您尝试在 bash 中进行算术运算时,这会产生问题,您尝试添加的数字会给您带来奇怪的结果。
网络技术联盟站
2022/04/21
1.5K0
如何在 Bash 中将字符串计算为数字?
如何在 Linux 中将目录添加到 PATH 变量,方便执行自定义命令
在 Linux 系统中,PATH 变量是一个非常重要的环境变量,用于指定系统在执行命令时搜索可执行文件的路径。默认情况下,系统会在预定义的一组目录中查找可执行文件。但是,有时候我们可能需要将自定义的目录添加到 PATH 变量中,以便系统能够找到我们自己创建的可执行文件。在本文中,我们将学习如何在 Linux 中将目录添加到 PATH 变量,以便能够方便地执行自定义的命令。
网络技术联盟站
2023/06/09
2.5K0
如何在 Linux 中将目录添加到 PATH 变量,方便执行自定义命令
python中将字符串转为json对象并取值
"messages": ["Could not find resource or operation 'BZK1.MapServer' on the system."],
用户7886150
2021/01/16
2.2K0
如何在 JS 中将字符串切割成字符?
(10) ["D", "r", "a", "g", "o", "n", " ", "�", "�", " "]
酷酷的哀殿
2020/10/26
1.4K0
如何在 TypeScript 中将字符串转换为日期对象?
在应用程序中,我们经常需要将日期字符串转换为日期对象。在 TypeScript 中,由于类型系统的存在,这个过程可能需要一些额外的步骤。在本文中,我们将讨论如何在 TypeScript 中将字符串转换为日期对象,并解决在此过程中可能遇到的一些问题。
网络技术联盟站
2023/06/07
3.5K0

相似问题

Windows窗体和WCF服务

12

WCF请求来自windows窗体,而不是windows服务。

12

WCF:从服务内部访问windows窗体

22

WCF,从服务访问windows窗体控件

50

使用wcf服务Windows窗体应用程序

23
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文