Esempio n. 1
0
        private FxDataAdapter()
        {
            FxProviderFactories.RegisterFactories();
            _providerFactory = DbProviderFactories.GetFactory(FxDatabaseSettings.GetProviderInvariant());
            _connection      = _providerFactory.CreateConnection();
            if (_connection != null)
            {
                _connection.ConnectionString = FxDatabaseSettings.GetConnectionString();
                _dataAdapter = _providerFactory.CreateDataAdapter();

                _commandBuilder             = _providerFactory.CreateCommandBuilder();
                _commandBuilder.DataAdapter = _dataAdapter;
            }
            else
            {
                throw new Exception("Connection not created");
            }
        }
Esempio n. 2
0
 public static void RegisterFactories()
 {
     DbProviderFactories.RegisterFactory(FxDatabaseSettings.GetProviderInvariant(), FxDatabaseSettings.GetProviderType());
 }