2011-09-26 114 views
0

我從C#(.NET 4.0)創建了一個dtsx,但是當我嘗試將OLEDB源添加到數據流中並且是執行ProvideComponentProperties步驟的時候,我收到以下錯誤在VS2010: 從HRESULT異常:0xC0048021從C#創建SQL Server 2008 R2 DTSX - 從HRESULT異常:0xC0048021

這是我使用的代碼的一部分:

//add SQL destination 
IDTSComponentMetaData100 SQLDestination = dataflowTask.ComponentMetaDataCollection.New(); 
SQLDestination.ComponentClassID = "DTSAdapter.OleDbSource.1"; 
// Set the common properties    
SQLDestination.Name = "SQLDestination"; 
SQLDestination.Description = "SQL destination"; 
CManagedComponentWrapper SQLDestComponent = SQLDestination.Instantiate(); 
SQLDestComponent.ProvideComponentProperties(); // The error happens here 

我使用SQL Server 2008 R2 SP1和C#.NET框架4.0

+1

它可能是GAC問題嗎? http://technet.microsoft.com/en-us/library/microsoft.sqlserver.dts.pipeline.wrapper.idtsdesigntimecomponent90.providecomponentproperties(v=sql.90).aspx http://social.msdn.microsoft.com/論壇/ EN/sqlintegrationservices /線程/ c74758d2-e3f7-4d4d-9d8a-9684c05b8628 – billinkc

回答

0

您僅限於VS2008和.NET 3.5 for SQL2008 R2。