久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如果從網絡路徑執行 EXE,則 SqlConnection 錯誤

SqlConnection Error if EXE is executed from network path(如果從網絡路徑執行 EXE,則 SqlConnection 錯誤)
本文介紹了如果從網絡路徑執行 EXE,則 SqlConnection 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

首先:您在這篇文章中讀到的所有內容在安裝了 Windows 10 April 2018 更新的情況下發生.安裝前更新卸載后都沒有問題.

First of all: everything you will read in this post happens only if Windows 10 April 2018 update is installed. No problem before installation and after update uninstallation.

安裝 Windows 10 1803 更新后,我所有從網絡映射驅動器或 UNC 路徑運行的 VB 程序(VB6、.NET 和 WPF)都無法連接到 SQL 服務器,如果在本地放置并執行相同的可執行文件,則沒問題驅動器(在同一網絡中的 2 臺電腦上測試):

After installing Windows 10 1803 update, all my VB program (VB6, .NET and WPF) running from network mapped drive or UNC path can't connect to SQL server, no problem if the same executable is placed and executed from local drive (tested on 2 pc in the same network):

  1. 遠程 SQL 服務器,本地驅動器上的 exe:OK
  2. 相同遠程 SQL 服務器,映射網絡驅動器上的 相同 exe(具有完全讀/寫訪問權限):錯誤
  1. Remote SQL server, exe on local drive: OK
  2. Same remote SQL server, same exe on mapped network drive (with full read/write access): ERROR

這是錯誤(可能對解決此問題沒有意義):

This is the error (maybe not significat to solve this problem):

與 SQL Server 建立連接時發生與網絡相關或特定于實例的錯誤.服務器未找到或無法訪問.驗證實例名稱是否正確以及 SQL Server 是否配置為允許遠程連接.(提供程序:SQL 網絡接口,錯誤:26 - 錯誤定位服務器/指定的實例).

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).

簡單的VB.NET代碼復現問題(將代碼放在一個簡單的形式,在button_click事件中加一個按鈕,設置值連接到SQL服務器,編譯,將exe文件保存在網絡路徑上并執行)):

Simple VB.NET code to reproduce the problem (place the code in a simple form with a button in the button_click event, set values to connect to the SQL server, compile, save the exe file on a network path and execute it):

Dim myConnectionString As String
Dim mySqlConnectionStringBuilder As New SqlConnectionStringBuilder()
mySqlConnectionStringBuilder.DataSource = myServer
mySqlConnectionStringBuilder.InitialCatalog = myDatabase
mySqlConnectionStringBuilder.UserID = myUtente
mySqlConnectionStringBuilder.Password = myPassword
myConnectionString = mySqlConnectionStringBuilder.ConnectionString

Dim mySqlConnection As New SqlConnection(myConnectionString)
mySqlConnection.Open()  <- error

異常:

System.Data.SqlClient.SqlException (0x80131904): Si è verificato un errore di rete o specifico dell'istanza mentre si cercava di stabilire una connessione con SQL Server. Il server non è stato trovato o non è accessibile. Verificare che il nome dell'istanza sia corretto e che SQL Server sia configurato in modo da consentire connessioni remote. (provider: SQL Network Interfaces, error: 26 - Errore nell'individuazione del server/dell'istanza specificata)
   in 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, SqlAuthenticationProviderManager sqlAuthProviderManager)
   in System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   in System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   in System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   in System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   in System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   in System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   in System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   in System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   in System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   in System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   in System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   in System.Data.SqlClient.SqlConnection.Open()
   in RiepilogoOreTimer.RiepilogoOreTimerWindow.ConnessioneOK()
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:-1,State:0,Class:20

有什么想法嗎?

更新:如果我卸載 2018 年 4 月的更新,問題就會消失,即使在網絡驅動器上執行該程序也能正常工作,但這不能成為解決方案...

Update: If I uninstall the April 2018 update the issue go away and the program works fine even if executed on a network drive, but this can't be the solution...

2018 年 8 月 5 日更新:我注意到 2018 年 4 月的更新帶來了一些 安全變化:

Update 08/05/2018: I noticed that April 2018 update brought some changes in security:

Windows 10 版本 1803 提供額外保護:

Windows 10, version 1803 provides additional protections:

  • 新的攻擊面減少規則
  • 受控文件夾訪問現在可以阻止磁盤扇區

這可能是問題的原因嗎?我不是安全經理,所以我不能說這是否會導致我的問題

Could it be the cause of the issue? I'm not a security manager so I can't say if this can cause my problem

2018 年 9 月 5 日更新:我在 this 帖子:

Windows 10 更新 1803 無法打開網絡連接SMBv1 共享上的可執行文件(如 Windows Server 2003)

Windows 10 update 1803 does not open network connections on executables files on SMBv1 share (as Windows Server 2003)

但我不知道什么是 SMBv1...有人可以幫助我嗎?

but I don't know what SMBv1 is... somebody can help me?

推薦答案

終于發現問題了:在共享文件夾的服務器中,SMBv2被禁用(不知道為什么)所以只有SMBv1處于活動狀態;從同一網絡中的同一客戶端執行的同一程序但位于啟用了 SMBv2 的服務器上運行正常.

Finally I found the problem: in the server with the shared folder, SMBv2 is disabled (I don't know why) so only SMBv1 is active; the same program executed from the same client in the same network but located on a server with SMBv2 enabled works fine.

所以問題是關于 SMBv1 共享,從 Windows 10 1803 開始??棄用

So the problem is about SMBv1 share, deprecated starting from Windows 10 1803

這篇關于如果從網絡路徑執行 EXE,則 SqlConnection 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

What SQL Server Datatype Should I Use To Store A Byte[](我應該使用什么 SQL Server 數據類型來存儲字節 [])
Interpreting type codes in sys.objects in SQL Server(解釋 SQL Server 中 sys.objects 中的類型代碼)
Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否應該返回“1?什么時候不能投射為日期?)
Converting the name of a day to its integer representation(將一天的名稱轉換為其整數表示)
How to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中將 nvarchar m/d/yy 轉換為 mm/dd/yyyy?)
主站蜘蛛池模板: 国产精品一码二码三码在线 | 国产高清毛片 | 久久精品欧美电影 | 国产综合久久 | 男女性毛片 | 亚洲欧美第一视频 | 在线观看视频h | 91久久精品日日躁夜夜躁欧美 | 在线播放国产一区二区三区 | 免费观看色| 国产成人精品网站 | av黄色在线播放 | www.久久影视 | 久久久青草婷婷精品综合日韩 | 一区二区三区高清 | 国产精品精品视频一区二区三区 | 日韩 欧美 二区 | 天天操操| 国产精品91视频 | 玖玖视频 | 欧产日产国产精品视频 | 国产伦一区二区三区久久 | 久久精品亚洲欧美日韩精品中文字幕 | 国产成人精品一区二三区在线观看 | 91佛爷在线观看 | 国产一区二区免费 | 自拍偷拍亚洲一区 | 久久中文字幕在线 | 成人综合久久 | 成人精品鲁一区一区二区 | 亚洲精品久久久一区二区三区 | 天堂精品视频 | 欧美精品久久 | 午夜精品一区二区三区在线播放 | 中文字幕第一页在线 | 99精品久久久久 | 怡红院怡春院一级毛片 | 日韩成人在线视频 | 日本特黄特色aaa大片免费 | 国产精品自在线 | 日本视频一区二区三区 |