我得到下面的錯誤,而使用traceReader.InitializeAsReader(connDef, "D:\\trace.tdf");
出錯初始化跟蹤讀者
錯誤:
2013-07-25 13:59:53,578 [8] DEBUG Error while invoking InitializeAsReaderException has been thrown by the target of an invocation. Microsoft.SqlServer.Management.Trace.SqlTraceException: Failed to initialize object as reader. ---> System.Runtime.InteropServices.COMException at ?A0xe4daab47.ProcessError(Int32 hr, UInt16* lpszMessage) at Microsoft.SqlServer.Management.Trace.CTraceControllerBase.InitSource(Boolean bReOpen) at Microsoft.SqlServer.Management.Trace.CTraceObjectsRowsetController.InitSource(Boolean bReOpen) at Microsoft.SqlServer.Management.Trace.TraceServer.InitializeAsReader(ConnectionInfoBase serverConnInfo, String profileFileName) --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Trace.TraceServer.InitializeAsReader(ConnectionInfoBase serverConnInfo, String profileFileName).
場景:加載
I use sql 2012 server under windows 2008 R2.
組件是
connectionInfoAssembly = Assembly.Load("Microsoft.SqlServer.ConnectionInfo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
traceAssembly = Assembly.Load("Microsoft.SqlServer.ConnectionInfoExtended, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
smoAssembly = Assembly.Load("Microsoft.SqlServer.Smo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
ConnInfo是
server='';Trusted_Connection=true;multipleactiveresultsets=false --- Database name.
什麼,我做錯了什麼?
您在DEBUG記錄錯誤? – Amy