Sunday, 18 June 2023

Convert SSIS recordset into datatable

Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.DataTable'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however, they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

 

DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(); 
da.Fill(dt, Dts.Variables["User::objList"].Value);

No comments:

Post a Comment