VS 2017 ADO.NET 链接 SQL server 数据库,一直链接不不上,请大神解答!

一直链接不上数据库,行27报错,请大神解答!谢谢!



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

系统找不到指定的文件。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.ComponentModel.Win32Exception: 系统找不到指定的文件。

源错误: 

行 25:         private void UserDisPlay()
行 26:  

{行 27:             sqlConn.Open();

行 28:

行 29:             string mySQL = "SELECT * FORM userLogin";
   


源文件: E:\NET\NewuserLogin\NewuserLogin\WebForm1.aspx.cs    行: 27 

堆栈跟踪: 

[Win32Exception (0x80004005): 系统找不到指定的文件。]

[SqlException (0x80131904): 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - 无法打开到 SQL Server 的连接)]
  System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling) +1379
  System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +452
  System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +70
  System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +927
  System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +109
  System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1550
  System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +117
  System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +258
  System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +314
  System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +126
  System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +255
  System.Data.SqlClient.SqlConnection.Open() +128
  NewuserLogin.WebForm1.UserDisPlay() in E:\NET\NewuserLogin\NewuserLogin\WebForm1.aspx.cs:27
  NewuserLogin.WebForm1.Page_Load(Object sender, EventArgs e) in E:\NET\NewuserLogin\NewuserLogin\WebForm1.aspx.cs:21
  System.Web.UI.Control.OnLoad(EventArgs e) +103
  System.Web.UI.Control.LoadRecursive() +68
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1381
   


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.2556.0


qq_企鹅_13
浏览 4024回答 1
1回答

qq_小阿婷_bjqGV5

我也是同样的问题,烦
打开App,查看更多内容
随时随地看视频慕课网APP