C# 当我将asp.net和数据库文件上载到服务器并尝试打开网站时

C# 当我将asp.net和数据库文件上载到服务器并尝试打开网站时,c#,sql,asp.net,database,sql-server-2008-r2,C#,Sql,Asp.net,Database,Sql Server 2008 R2,它在我的笔记本电脑上工作,但当我将它上传到服务器上时,它不工作,并说: 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 origi

它在我的笔记本电脑上工作,但当我将它上传到服务器上时,它不工作,并说:

  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:


 Line 58:             using (SqlCommand cmd1 = new SqlCommand("Select word_text from words where word_id = 1", con))
Line 59:             {
 Line 60:                 con.Open(); "That show in red"
 Line 61:                 SqlDataReader dr = cmd1.ExecuteReader();
 Line 62:                 if (dr.Read())
这是来自服务器的连接字符串:

      Connection string:    workstation id=textdatabase.mssql.somee.com;packet size=4096;user id=Naeemh_SQLLogin_1;pwd=t7xtp3wlad;data source=textdatabase.mssql.somee.com;persist security info=False;initial catalog=textdatabase
我的笔记本电脑中的连接:

连接字符串:数据源=Q-PC;初始目录=文本;集成的
Security=True
我忘记更改密码了

connection string in the ASP.NET files

可能是数据库连接不正确。我确信它是正确的。它写入con.Open();红色当我从服务器打开时,错误与数据库无关,它告诉您错误是什么。。您的
.aspx页面或代码隐藏中是否有硬编码路径
您需要显示相关的代码。您如何知道这是导致错误的那一行,可能是在点击这一行之前上面的代码。。编辑问题并显示所有相关代码。同时添加一些日志记录,以便您准确地知道错误发生的位置。。跟踪日志在哪里。。?然后再次向我们显示实际的连接字符串,因为本地服务器上的路径与远程服务器上的路径不同。。