ASP.NE网站发布问题,高手进,急!!!!!!!!!!!!!!

zhang429139060 2012-08-10 10:46:38
大哥些,我做的ASP.NET网站在本地运行没有一点问题,但是发布出去就出现了下面的情况
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Data.SqlClient.SqlException: 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:


[SqlException (0x80131904): 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4860189
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +376
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1297
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842




--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3634; ASP.NET 版本:2.0.50727.3634

web.config代码如下





<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLExpress ;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString1" connectionString="Data Source=.\SQLExpress ;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString2" connectionString="Data Source=.\SQLExpress ;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString3" connectionString="Data Source=.\SQLExpress ;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString4" connectionString="Data Source=.\SQLExpress ;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString5" connectionString="Data Source=.\SQLExpress;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString6" connectionString="Data Source=.\SQLExpress ;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString7" connectionString="Data Source=.\SQLExpress ;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString8" connectionString="Data Source=.\SQLExpress;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString9" connectionString="Data Source=.\SQLExpress;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString10" connectionString="Data Source=.\SQLExpress;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString11" connectionString="Data Source=.\SQLExpress;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />
<add name="ConnectionString12" connectionString="Data Source=.\SQLExpress;AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT\chen.mdf;Integrated Security=True;Connect Timeout=30;User ID= chen;Password=U2iS5oDwZu"
providerName="System.Data.SqlClient" />


</connectionStrings>
<system.web>
<!--
设置 compilation debug="true" 将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug="true"/>
<!--
通过 <authentication> 节可以配置 ASP.NET 使用的
安全身份验证模式,
以标识传入的用户。
-->
<authentication mode="Windows"/>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<customErrors mode="Off"/>

</system.web>

</configuration>
数据库服务器和网站服务器为同一个ip,数据库在服务器上的路径是AttachDbFilename=D:\www\web\zgdgzy.com_jTPLy0ETmQYQ6u0lniCT
求高手们,伸出援助之手,帮帮菜鸟我,我已经是黔驴技穷了

急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...全文
139 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhang429139060 2012-08-10
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 的回复:]
我怀疑你配置文件数据库连接写错了
[/Quote]
请问哪儿错了啊,怎么修改?
誰是方長 2012-08-10
  • 打赏
  • 举报
回复
我怀疑你配置文件数据库连接写错了
zhang429139060 2012-08-10
  • 打赏
  • 举报
回复
额,还有可能是其他的问题吗,比如说连接字符串啊
zhang429139060 2012-08-10
  • 打赏
  • 举报
回复
你确定啊,我怀疑也是这样的,是不是服务器上,数据库没有打开远程连接啊,求高手支招
q107770540 2012-08-10
  • 打赏
  • 举报
回复
解决方法:开始->>SQLServer2005->>配置工具->>SQLServer外围应用配置器->> 服务和外围连接的应用配置器->>点击"远程连接"->>本地连接和远程连接->> 同时使用TCP/IP和named Pipes->>点"确定"->>重启SQLserver服务
q107770540 2012-08-10
  • 打赏
  • 举报
回复
服务器上的数据库配置问题

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧