问题描述
有关调用
实时(JIT)调试而不是此对话框的详细信息,请参阅此消息的结尾。
**************异常文本**************
System.Data.SqlClient.SqlException(0x80131904) :与SQL Server建立连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:命名管道提供程序,错误:40 - 无法打开与SQL Server的连接)---> System.ComponentModel.Win32Exception(0x80004005):用户名或密码不正确
在System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity标识,SqlConnectionString connectionOptions,SqlCredential凭证,Object providerInfo,String newPassword ,SecureString newSecurePassword,Boolean redirectedUserInstance,SqlConnectionString userConnectionOptions,SessionData reconnectSessionData,DbConnectionPool pool,String accessToken,Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options,DbConnectionPoolKey poolKey,Object poolGroupProviderInfo, DbConnectionPool池,DbConnection owningConnection,DbConnectionOptions userOptions)
在System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool池,DbConnection owningObject,DbConnectionOptions选项,DbConnectionPoolKey poolKey,DbConnectionOptions userOptions)
在System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject,DbConnectionOptions) System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,UInt32 waitForMultipleObjectsTimeout,Boolean allowCreate,Boolean onlyOneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal&连接)
在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource`1 retry,DbConnectionOptions userOptions,DbConnectionInternal& connection)
在System.Data.ProviderBase .DbConnectionFactory.TryGetConnection(DbConnection owningConnection,TaskCompletionSource`1 retry,DbConnectionOptions userOptions,DbConnectionInternal oldConnection,DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection,DbConnectionFactory connectionFactory,TaskCompletionSource` 1重试,DbConnectionOptions userOptions)
在System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory,TaskCompletionSource`1 retry,DbConnectionOptions userOptions)
在System。 Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1重试)
在System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1重试)
在System.Data.SqlClient.SqlConnection.Open()
在WEIGHBAL.Index。 Index_Load(Object sender,EventArgs e)
在System.Windows.Forms.Form.OnLoad(EventArgs e)
在System.Windows.Forms.Form.OnCreateControl()
在System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在System.Windows.Forms.Control.CreateControl()
在System.Windows.Forms.Control.WmShowWindow(Message& m)
在System.Windows.Forms.Control.WndProc(Message& m)
在System.Windows.Forms.ScrollableControl.WndProc(Message& m)
(消息& m)
在System.Windows.Forms.Form.WndProc(消息& m)
$ b System.Windows.Forms.Control.ControlNativeWindow.OnMessage上的$ b(消息& m)
在System.Windows.Forms.Control.ControlNativeWindow.WndProc(消息& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)
ClientConnectionId:00000000-0000-0000-0000-000000000000
错误号码:1326,州:0,等级:20
************ **已加载的大会**************
mscorlib
汇编版本:4.0.0.0
Win32版本:4.6.1080.0构建者:NETFXREL3STAGE
CodeBase:file:/// C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.d ll
----------------------------------------
WEIGHBAL
汇编版本:1.0.0.0
Win32版本:1.0.0.0
CodeBase:file:// /C:/Users/RDP/AppData/Local/Apps/2.0/OK5TV6K8.7LE/LK8WVT8D.RK2/weig..tion_94b71764d11d8afd_0001.0000_de19757f3c9f7327/WEIGHBAL.exe
-------- --------------------------------
System.Data
汇编版本:4.0.0.0
Win32版本:4.6.1082.0内建者:NETFXREL3STAGE
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly /GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
---------------------- ------------------
系统
汇编版本:4.0.0.0
Win32版本:4.6.1081.0内容:NETFXREL3STAGE
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
系统tem.Core
汇编版本:4.0.0.0
Win32版本:4.6.1038.0内建者:NETFXREL2
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
------------ ----------------------------
System.Windows.Forms
汇编版本:4.0.0.0
Win32版本:4.6.1038.0内建者:NETFXREL2
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL /System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
-------------------- --------------------
System.Drawing
汇编版本:4.0.0.0
Win32版本:4.6.1078.0构建者:NETFXREL3STAGE
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0 .0__b03f5f7f11d50a3a / System.Drawing.dll
---------------------------------- ------
System.Configuration
汇编版本:4.0.0.0
Win32版本:4.6.1038.0内建者:NETFXREL2
CodeBase:file:/// C:/ WINDOWS / Microsoft。 Net / assembly / GAC_MSIL / System.Configuration / v4.0_4.0.0.0__b03f5f7f11d50a3a / System.Configuration.dll
------------------- ---------------------
System.Xml
汇编版本:4.0.0.0
Win32版本:4.6.1064.2构建者:NETFXREL3STAGE
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4。 0.0.0__b77a5c561934e089 / System.Xml.dll
--------------------------------- -------
System.Transactions
汇编版本:4.0.0.0
Win32版本:4.6.1080.0内建者:NETFXREL3STAGE
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
汇编版本:4.0.0.0
Win32版本:4.6.1038.0内建者:NETFXREL2
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/ assembly / GAC_32 / System.EnterpriseServices / v4.0_4.0.0.0__b03f5f7f11d50a3a / System.EnterpriseServices.dll
--------------------- -------------------
System.Numerics
汇编版本:4.0.0.0
Win32版本:4.6.1038.0内建者:NETFXREL2
CodeBase:file:/// C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0。 0__b77a5c561934e089 / System.Numerics.dll
----------------------------------- -----
************** JIT调试************* *
要启用即时(JIT)调试,此
应用程序或计算机(machine.config)的.config文件必须具有
jitDebugging值在system.windows.forms部分设置。
应用程序也必须使用调试编译
启用。
例如:
< configuration>
< system.windows。表格jitdebugging =true>
启用JIT调试后,任何未处理的异常
将被发送到计算机上注册的JIT调试器
而不是被这个对话框处理。
我试过的:
< configuration>
< system.windows.forms jitdebugging =true>
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.SqlClient.SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The user name or password is incorrect
at 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)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at WEIGHBAL.Index.Index_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:1326,State:0,Class:20
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1080.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
WEIGHBAL
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/RDP/AppData/Local/Apps/2.0/OK5TV6K8.7LE/LK8WVT8D.RK2/weig..tion_94b71764d11d8afd_0001.0000_de19757f3c9f7327/WEIGHBAL.exe
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1082.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1081.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1078.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1064.2 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1080.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1038.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
What I have tried:
<configuration>
<system.windows.forms jitdebugging="true">
推荐答案
System.Data.SqlClient.SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
它甚至可以告诉您确切要做什么以及要检查什么! />
请查看代码,找到创建SqlConnection的位置并查看连接字符串。几乎可以肯定,这是错误的。
It even tells you exactly what to do and what to check!
So look at your code, find where you create the SqlConnection and look at the connection string. Almost certainly, it's wrong.
这篇关于准时制(JIT)?该怎么办.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!