public DB2iSeriesDataProvider(string name, DB2iSeriesLevels minLevel, bool mapGuidAsString, bool preventNVarChar = false) : base(name, null) { this.minLevel = minLevel; this.mapGuidAsString = mapGuidAsString; this.preventNVarChar = preventNVarChar; LoadExpressions(name, mapGuidAsString); SqlProviderFlags.AcceptsTakeAsParameter = false; SqlProviderFlags.AcceptsTakeAsParameterIfSkip = true; SqlProviderFlags.IsDistinctOrderBySupported = false; SqlProviderFlags.CanCombineParameters = false; SqlProviderFlags.IsParameterOrderDependent = true; SqlProviderFlags.IsCommonTableExpressionsSupported = true; if (mapGuidAsString) { SqlProviderFlags.CustomFlags.Add(DB2iSeriesTools.MapGuidAsString); } if (preventNVarChar) { SqlProviderFlags.CustomFlags.Add(DB2iSeriesTools.PreventNVarChar); } SetCharField("CHAR", (r, i) => r.GetString(i).TrimEnd(' ')); SetCharField("NCHAR", (r, i) => r.GetString(i).TrimEnd(' ')); _sqlOptimizer = new DB2iSeriesSqlOptimizer(SqlProviderFlags); }
/// <summary> /// Build a DB2 iSeries data provider. /// </summary> /// <param name="providerOptions">The provider's construction options, see <see cref="DB2iSeriesProviderOptions"/></param> public DB2iSeriesDataProvider(DB2iSeriesProviderOptions providerOptions) : base( providerOptions.ProviderName, GetMappingSchema( providerOptions.ProviderName, providerOptions.ProviderType, providerOptions.MapGuidAsString), DB2iSeriesProviderAdapter.GetInstance(providerOptions.ProviderType)) { this.db2iSeriesSqlProviderFlags = new DB2iSeriesSqlProviderFlags(providerOptions); this.mappingOptions = new DB2iSeriesMappingOptions(providerOptions); this.ProviderType = providerOptions.ProviderType; DB2iSeriesLoadExpressions.SetupExpressions(providerOptions.ProviderName, mappingOptions.MapGuidAsString); SqlProviderFlags.AcceptsTakeAsParameter = false; SqlProviderFlags.AcceptsTakeAsParameterIfSkip = true; SqlProviderFlags.IsDistinctOrderBySupported = false; SqlProviderFlags.CanCombineParameters = false; SqlProviderFlags.IsCommonTableExpressionsSupported = true; SqlProviderFlags.IsUpdateFromSupported = false; db2iSeriesSqlProviderFlags.SetCustomFlags(SqlProviderFlags); mappingOptions.SetCustomFlags(SqlProviderFlags); SetCharField(Constants.DbTypes.Char, (r, i) => r.GetString(i).TrimEnd(' ')); SetCharField(Constants.DbTypes.NChar, (r, i) => r.GetString(i).TrimEnd(' ')); SetCharField(Constants.DbTypes.Graphic, (r, i) => r.GetString(i).TrimEnd(' ')); sqlOptimizer = new DB2iSeriesSqlOptimizer(SqlProviderFlags, db2iSeriesSqlProviderFlags); schemaProvider = new DB2iSeriesSchemaProvider(this); bulkCopy = new DB2iSeriesBulkCopy(this); if (ProviderType.IsOdbc()) { SetupOdbc(); } else if (ProviderType.IsOleDb()) { SetupOleDb(); } #if NETFRAMEWORK else if (ProviderType.IsAccessClient()) { SetupAccessClient(); } #endif else if (ProviderType.IsDB2()) { SetupDB2Connect(); } }
public DB2iSeriesDataProvider(DB2iSeriesLevels minLevel) : base(DB2iSeriesFactory.ProviderName, null) { this.minLevel = minLevel; DB2iSeriesExpressions.LoadExpressions(); SqlProviderFlags.AcceptsTakeAsParameter = false; SqlProviderFlags.AcceptsTakeAsParameterIfSkip = true; SqlProviderFlags.IsDistinctOrderBySupported = true; SqlProviderFlags.CanCombineParameters = false; SqlProviderFlags.IsParameterOrderDependent = true; SetCharField("CHAR", (r, i) => r.GetString(i).TrimEnd()); _sqlOptimizer = new DB2iSeriesSqlOptimizer(SqlProviderFlags); }