I encountered an issue with SSIS & EzAPI. Here's the code
EzPackage package = new EzPackage();
package.Name = "[Insert My Table Name]";
EzDataFlow parent = new EzDataFlow(package);
dataFlow.Name = package.Name;
EzFlatFileCM destConn = new EzFlatFileCM(parent);
destConn.ConnectionString = connectionString;
destConn.Format = FlatFileFormat.Delimited;
destConn.ColumnDelimiter = "";
destConn.RowDelimiter = "\n";
destConn.ColumnNamesInFirstDataRow = false;
destConn.LocaleID = 127;
if (isUnicode)
destConn.CodePage = 65001;
EzFlatFileDestination destination = new EzFlatFileDestination(parent);
destination.Connection = destConn;
destination.Overwrite = true;
/// ColumnSchema is a container for some column information
foreach (ColumnSchema col in columns)
{
IDTSConnectionManagerFlatFileColumn100 newColumn = data.Columns.Add();
newColumn.ColumnType = "Delimited";
newColumn.DataType = col.Type;
newColumn.ColumnDelimiter = IsLastColumnInArray(col ) ? "\n" : "";
newColumn.ColumnWidth = (col.Type == DbColumnType.LongString) ? (int) Constants.LongStringLength : (int) Constants.StringLength;
var columnName = newColumn as IDTSName100;
if (columnName != null)
columnName.Name = GetColumnAlias(col.Name, columns);
}
List<EzFlatFileDestination> destinations = new List<EzFlatFileDestination>();
destinations.Add(destin);
/// This line will blow up
EzDerivedColumn derivedColumn = new EzDerivedColumn(parent);
Error message:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in EzAPI.dll
Additional information: Exception from HRESULT: 0xC0048021
Now, here's my setup: - I installed Microsoft SQL Server 2012 Client SDK and made sure all the v110 DLLs are installed in both Program Files and GAC (Yes, they all say 11.0.0.0) - I built EzAPI.dll by downloading latest source of EzAPI: https://sqlsrvintegrationsrv.codeplex.com/SourceControl/latest. I made sure all the DLL references in the project point to 11.0.0.0 and Specific Version = true - There are other versions of Microsoft.SqlServer.****.dll files in the GAC and program files, such as ones for v100 and v120. However these other-versioned DLLs are not used anywhere else in the program and they are not included in my program's bin folder. - .NET version is 4.5 when building EzAPI.dll and in my project
Anyhow, I am stumped. I found articles with this error on web but they usually talk about how the there's a mismatch of DLLs or some of the DLLs not being installed but I don't see how these scenarios apply to me. Am I misusing EzDerivedColumn somehow? Well, it's hard to know because my error message is very vague.
Any help on this would be great. Thanks!