private ColumnMapper generateColumnMapper(FeatureDataTable schemaModel) { Int32 targetCount = _targetDataTable.Columns.Count; Int32 sourceCount = schemaModel.Columns.Count; ColumnMapper mapper = new ColumnMapper(sourceCount, targetCount); foreach (DataColumn column in schemaModel.Columns) { int trgtOrdinal = _targetDataTable.Columns[column.ColumnName].Ordinal; if (trgtOrdinal == -1 && (_mergeAction & SchemaMergeAction.CaseInsensitive) != SchemaMergeAction.None) { foreach (DataColumn c in _targetDataTable.Columns) { if (String.Compare(c.ColumnName, column.ColumnName, StringComparison.CurrentCultureIgnoreCase) == 0) { trgtOrdinal = c.Ordinal; break; } } } mapper.AddMapping(column.Ordinal, trgtOrdinal); } return mapper; }