首页 新闻 赞助 找找看

急啊 网站在本地上没问题到服务器上面有问题

0
悬赏园豆:50 [已关闭问题] 关闭于 2012-07-23 13:26

“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

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

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

源错误:  


行 32: //try
行 33: //{
行 34: conn.Open();
行 35: SqlDataAdapter da = new SqlDataAdapter(sql, conn);
行 36: da.Fill(ds);
 

源文件: d:\wwwroot\haiis\demo10\App_Code\SqlHelper.cs 行: 34  

堆栈跟踪:  


[SqlException (0x80131904): 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)]
  System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428
  System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
  System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
  System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
  System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +96
  System.Data.SqlClient.SqlConnection.Open() +122
  SqlHelper.getData(String sql) in d:\wwwroot\haiis\demo10\App_Code\SqlHelper.cs:34
  rdatadrain.DoDataBind() in d:\wwwroot\haiis\demo10\rdatadrain.aspx.cs:25
  System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
  System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
  System.Data.SqlClient.SqlConnection.Open() +122
  System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
  System.Web.UI.Control.OnLoad(EventArgs e) +99
  System.Web.UI.Control.LoadRecursive() +50
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  SqlHelper.getData(String sql) in d:\wwwroot\haiis\demo10\App_Code\SqlHelper.cs:34
  SqlHelper.getData(String sql) in d:\wwwroot\haiis\demo10\App_Code\SqlHelper.cs:34
  rdataom.DoDataBind() in d:\wwwroot\haiis\demo10\rdataom.aspx.cs:25
  rdatadrain.DoDataBind() in d:\wwwroot\haiis\demo10\rdatadrain.aspx.cs:25
  System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
  rdatadrain.Page_Load(Object sender, EventArgs e) in d:\wwwroot\haiis\demo10\rdatadrain.aspx.cs:18
  System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
  System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
  System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
  System.Web.UI.Control.LoadRecursive() +50
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  System.Web.UI.Control.LoadRecursive() +50
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

 


--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3634; ASP.NET 版本:2.0.50727.3634  
这是错误提示  

web。config里面是这样的

<connectionStrings><add name="huaian2008ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename='|DataDirectory|\huaian2009.mdf';Integrated Security=True;User Instance=True"/></connectionStrings>

这个是服务器上面的错误  求大神啊

隔壁王叔的主页 隔壁王叔 | 初学一级 | 园豆:4
提问于:2012-07-19 12:34
< >
分享
所有回答(5)
0

服务器上文件读写权限设置了吗?就是把huaian2009.mdf所在目录设置为iis用户可以读写

飞来飞去 | 园豆:2057 (老鸟四级) | 2012-07-19 12:46

貌似不是这个问题

支持(0) 反对(0) 隔壁王叔 | 园豆:4 (初学一级) | 2012-07-19 14:36
0

装数据库了吗

LCM | 园豆:6876 (大侠五级) | 2012-07-19 14:30

装了2005的

支持(0) 反对(0) 隔壁王叔 | 园豆:4 (初学一级) | 2012-07-19 14:36
0

这样会导致网站有问题,我们网站降权都是服务器的问题www.gutiantongchengyou.com

伊本佐伊 | 园豆:210 (菜鸟二级) | 2012-07-19 15:02

你这不会是来做外链的吧

支持(0) 反对(0) 隔壁王叔 | 园豆:4 (初学一级) | 2012-07-19 22:57
0

装个2008看看

Tom.汤 | 园豆:3026 (老鸟四级) | 2012-07-23 12:40
0

连接字符串的问题

隔壁王叔 | 园豆:4 (初学一级) | 2012-07-23 13:25
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册