0

我使用 SMO 编写了一个应用程序,它在我的开发 PC 上安装并运行良好,甚至安装在另一个位置并运行它,但是当我将它移动到另一台机器时,它会出现以下错误

Log Name:      Application
Source:        .NET Runtime
Date:          4/10/2012 12:03:56 PM
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      ip-0A3AF6C2
Description:
Application: DataExport.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.SqlServer.Management.Common.ConnectionFailureException
Stack:
   at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()
   at DataExport.Data.SqlDataService.GetTableNames(System.String)
   at DataExport.Adapter.DataExportAdapter.GetTableNames(System.String)
   at DataExport.DataExportForm.SetInitialEditDisplay(DataExport.Adapter.IDataExportAdapter)
   at DataExport.DataExportForm..ctor(DataExport.Adapter.IDataExportAdapter)
   at DataExport.Program.Main()

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1026</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2012-04-10T11:03:56.000Z" />
    <EventRecordID>72945</EventRecordID>
    <Channel>Application</Channel>
    <Computer>ip-0A3AF6C2</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Application: DataExport.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.SqlServer.Management.Common.ConnectionFailureException
Stack:
   at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()
   at DataExport.Data.SqlDataService.GetTableNames(System.String)
   at DataExport.Adapter.DataExportAdapter.GetTableNames(System.String)
   at DataExport.DataExportForm.SetInitialEditDisplay(DataExport.Adapter.IDataExportAdapter)
   at DataExport.DataExportForm..ctor(DataExport.Adapter.IDataExportAdapter)
   at DataExport.Program.Main()
</Data>
  </EventData>
</Event>

我不知道如何解决这个问题,SMO dll 包含在包中

安装后的文件列表

旧版本的 smo (pre 10) 是否有可能覆盖包含的 dll?

4

1 回答 1

0

OK the solution is that SMO 10 is only for Server 2008, it will not work with 2005 SQL Express So the answer was to lower the version to 9.0

于 2012-04-11T12:25:34.437 回答