打开Winform时出错:目标主体名称不正确。无法生成SSPI上下文

时间:2019-05-17 03:12:12

标签: sql sql-server winforms sql-server-2008

我在计算机B上安装了Windows应用程序。它正在尝试使用静态IP连接到计算机A上的SQL Server数据库。

(完成所有与SQL Server相关的配置以建立远程连接)

我真的无法弄清楚在哪里寻找问题。请在下面查看我的错误。

连接字符串:

<connectionStrings>
    <add name="MassComputers.Properties.Settings.MaxCompConnectionString"
         connectionString="Data Source=192.xxx.xx.xxx,1433;Initial Catalog=MaxComp;Persist Security Info=True;User ID=sa;Password=pass@word1"
         providerName="System.Data.SqlClient" />
</connectionStrings>

错误:

  

有关调用即时(JIT)调试而不是此对话框的详细信息,请参阅此消息的结尾。

     

**************异常文本**************
  System.Data.SqlClient.SqlException(0x80131904):目标主体名称不正确。无法生成SSPI上下文。

     在System.Data.SqlClient.SqlInternalConnectionTds..ctor中的


  在System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项,DbConnectionPoolKey poolKey,对象poolGroupProviderInfo,DbConnectionPool池,DbConnection owningConnection,DbConnectionOptions userOptions)
  在System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection处(DbConnectionPool池,DbConnection owningObject,DbConnectionOptions选项,DbConnectionPoolKey poolKey,DbConnectionOptions userOptions)
  在System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject,DbConnectionOptions userOptions,DbConnectionInternal oldConnection)          在System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject,DbConnectionOptions userOptions,DbConnectionInternal oldConnection)          在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,UInt32 waitForMultipleObjectsTimeout,布尔值allowCreate,仅布尔值OneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal&连接)          在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource 1重试,DbConnectionOptions userOptions,DbConnectionInternal oldConnection,DbConnectionInternal&连接)处          在System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal处(DbConnection externalConnection,DbConnectionFactory connectionFactory,TaskCompletionSource 1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource 1重试,DbConnectionOptions userOptions)          在System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 1重试)          在System.Data.SqlClient.SqlConnection.Open()          在MassComputers.Forms.FindInventory.FindInventory_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)          在System.Windows.Forms.Form.WmShowWindow(Message&m)          在System.Windows.Forms.Form.WndProc(Message&m)          在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)          在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&m)          在System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)       ClientConnectionId:55283ad0-afa5-470f-950f-914c4e5240fd

     

**************加载的装配体**************
  mscorlib
         程序集版本:4.0.0.0
          Win32版本:4.7.2563.0创建人:NET471REL1
          代码库:file:/// C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
      ----------------------------------------
  MassComputers
          程序集版本:1.0.0.0
          Win32版本:1.0.0.0
          代码库:file:/// C:/ Program%20Files%20(x86)/Framework%20Technologies/My%20Product%20Name/MassComputers.exe
      ----------------------------------------
      System.Windows.Forms
          程序集版本:4.0.0.0           Win32版本:4.7.2558.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll       ----------------------------------------       系统           程序集版本:4.0.0.0           Win32版本:4.7.2558.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll       ----------------------------------------       系统绘图           程序集版本:4.0.0.0           Win32版本:4.7.2558.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll       ----------------------------------------       系统配置           程序集版本:4.0.0.0           Win32版本:4.7.2558.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll       ----------------------------------------       系统核心           程序集版本:4.0.0.0           Win32版本:4.7.2563.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll       ----------------------------------------       系统文件           程序集版本:4.0.0.0           Win32版本:4.7.2612.0创建人:NET471REL1LAST_B           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll       ----------------------------------------       系统数据           程序集版本:4.0.0.0           Win32版本:4.7.2623.0创建人:NET471REL1LAST_C           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll       ----------------------------------------       System.Data.DataSetExtensions           程序集版本:4.0.0.0           Win32版本:4.7.2558.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll       ----------------------------------------       系统数值           程序集版本:4.0.0.0           Win32版本:4.7.2558.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll       ----------------------------------------       系统交易           程序集版本:4.0.0.0           Win32版本:4.7.2558.0创建人:NET471REL1           代码库: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.7.2558.0创建人:NET471REL1           代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll       ----------------------------------------       System.Runtime.Caching           程序集版本:4.0.0.0           Win32版本:4.7.2558.0

     

代码库:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Caching/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.Caching.dll

     

************** JIT调试**************
  要启用即时(JIT)调试,此应用程序或计算机(machine.config)的.config文件必须在system.windows.forms部分中设置了jitDebugging值。该应用程序还必须在启用调试的情况下进行编译。

     

例如:

     


      
    

     

启用JIT调试后,任何未处理的异常都会发送到计算机上注册的JIT调试器,而不是由此对话框处理。

我确信它能够建立连接,因为它能够打开一些Winforms并获取查询结果。但是打开某些表格会显示上述错误。

0 个答案:

没有答案