Here are the examples of the csharp api class System.Data.Common.DbProviderFactory.CreateDataAdapter() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
43 Examples
0
1. Example
View licensepublic override DbDataAdapter CreateDataAdapter(DbCommand cmd) { DbDataAdapter da = DbFactory.CreateDataAdapter(); da.SelectCommand = cmd; return da; }
0
2. Example
View licensepublic override DbDataAdapter CreateDataAdapter() { var dataAdapter = _dbProviderFactory.CreateDataAdapter(); if (dataAdapter == null) { return null; } var profiledDataAdapter = dataAdapter as ProfiledDbDataAdapter; if (profiledDataAdapter != null) { return profiledDataAdapter; } return new ProfiledDbDataAdapter(dataAdapter, _dbProfiler); }
0
3. Example
View licensepublic IDbDataAdapter CreateDataAdapter(IDbCommand command) { IDbDataAdapter dataAdapter = Factory.CreateDataAdapter(); dataAdapter.SelectCommand = command; return dataAdapter; }
0
4. Example
View licensepublic DbDataAdapter GetDataAdapter() { return dbProvider.DbProviderFactory.CreateDataAdapter(); }
0
5. Example
View licensepublic DbDataAdapter GetDataAdapter() { return dbProvider.DbProviderFactory.CreateDataAdapter(); }
0
6. Example
View licensepublic DbDataAdapter GetDataAdapter() { return dbProvider.DbProviderFactory.CreateDataAdapter(); }
0
7. Example
View licensepublic override DbDataAdapter CreateDataAdapter() { return tail.CreateDataAdapter(); }
0
8. Example
View licensepublic IDbDataAdapter CreateDataAdapter() { return DbProviderFactory.CreateDataAdapter(); }
0
9. Example
View licenseprivate static DbDataAdapter _CreateDataAdapter(DbProviderFactory factory) { Debug.Assert(null != factory); // created DbDataAdapter adapter = factory.CreateDataAdapter(); return adapter; }
0
10. Example
View licensepublic override DbDataAdapter CreateDataAdapter() { var adapter = InnerFactory.CreateDataAdapter(); if (IsAdoMonitoringNeeded()) { return new GlimpseDbDataAdapter(adapter); } return adapter; }
0
11. Example
View licenseprotected DbDataAdapter GetDataAdapter(UpdateBehavior updateBehavior) { DbDataAdapter adapter = _DbProviderFactory.CreateDataAdapter(); if (updateBehavior == UpdateBehavior.Continue) { SetUpRowUpdatedEvent(adapter); } return adapter; }
0
12. Example
View licenseinternal IDbDataAdapter CreateAdapter(IDbCommand cmd) { IDbDataAdapter result; if(_factory != null) { result = _factory.CreateDataAdapter(); result.SelectCommand = cmd; } else { result = (IDbDataAdapter)_adapterConstructor.Invoke(new object[] { cmd }); } return result; }
0
13. Example
View licensepublic static DbDataAdapter CreateDataAdapter(string sqlCommand, IDbConnection connection) { var adapter = DbFactory.CreateDataAdapter(); var command = (DbCommand)connection.CreateCommand(); command.CommandText = sqlCommand; adapter.SelectCommand = command; return adapter; }
0
14. Example
View licensepublic static DataSet ExecuteDataSet(this DbCommand Command, DbProviderFactory Factory) { if (Command == null) return null; Command.Open(); using (DbDataAdapter Adapter = Factory.CreateDataAdapter()) { Adapter.SelectCommand = Command; var ReturnSet = new DataSet(); ReturnSet.Locale = CultureInfo.CurrentCulture; Adapter.Fill(ReturnSet); return ReturnSet; } }
0
15. Example
View licensepublic static DataSet ExecuteDataSet(this DbCommand Command, DbProviderFactory Factory) { if (Command == null) return null; Command.Open(); using (DbDataAdapter Adapter = Factory.CreateDataAdapter()) { Adapter.SelectCommand = Command; var ReturnSet = new DataSet(); ReturnSet.Locale = CultureInfo.CurrentCulture; Adapter.Fill(ReturnSet); return ReturnSet; } }
0
16. Example
View licensepublic DataTable ExecuteDataTable(string sql, IList<DbParameter> parameters, CommandType commandType) { using (DbCommand command = CreateDbCommand(sql, parameters, commandType)) { using (DbDataAdapter adapter = providerFactory.CreateDataAdapter()) { adapter.SelectCommand = command; DataTable data = new DataTable(); adapter.Fill(data); return data; } } }
0
17. Example
View licensepublic static DbDataAdapter CreateDataAdapter(DbConnection connection) { var providerName = GetProviderInvariantNameByConnectionString(connection.ConnectionString); return providerName != null ? DbProviderFactories.GetFactory(providerName).CreateDataAdapter() : null; }
0
18. Example
View licensepublic DataTable Exe?Command(string selectCommand) { DataTable data = new DataTable(); DbDataAdapter dataAdapter = dbProviderFactory.CreateDataAdapter(); DbCommand command = dbConnection.CreateCommand(); command.CommandText = selectCommand; try { dataAdapter.MissingMappingAction = MissingMappingAction.Passthrough; dataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey; dataAdapter.SelectCommand = command; dataAdapter.Fill(data); } catch (Exception e) { Console.WriteLine(e.Message); return data; } return data; }
0
19. Example
View licensepublic DataTable GetDataTable(string sql, DataTable dt, string tableName) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); try { using (DbDataAdapter adapter = ProviderFactory.CreateDataAdapter()) { Command.CommandText = sql; adapter.SelectCommand = Command; if (dt == null) dt = new DataTable(); adapter.Fill(dt); if (!string.IsNullOrEmpty(tableName)) dt.TableName = tableName; return dt; } } finally { CloseConnection(); // Clears parameters } }
0
20. Example
View licensepublic int UpdateDataSet(DataSet ds, string sql) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (ds == null) throw new ArgumentNullException("ds", "DataSet cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.UpdateCommand = Command; adapter.UpdateCommand.CommandText = sql; return adapter.Update(ds); } finally { if (adapter.UpdateCommand != null) adapter.UpdateCommand.Dispose(); adapter.Dispose(); } }
0
21. Example
View licensepublic int InsertDataTable(DataTable dt, string sql, UpdateRowSource updateRowSource) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (dt == null) throw new ArgumentNullException("dt", "DataTable cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.InsertCommand = Command; adapter.InsertCommand.CommandText = sql; adapter.InsertCommand.UpdatedRowSource = updateRowSource; return adapter.Update(dt); } finally { if (adapter.InsertCommand != null) adapter.InsertCommand.Dispose(); adapter.Dispose(); } }
0
22. Example
View licensepublic int DeleteDataTable(DataTable dt, string sql) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (dt == null) throw new ArgumentNullException("dt", "DataSet cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.DeleteCommand = Command; adapter.DeleteCommand.CommandText = sql; return adapter.Update(dt); } finally { if (adapter.DeleteCommand != null) adapter.DeleteCommand.Dispose(); adapter.Dispose(); } }
0
23. Example
View licensepublic DataTable GetDataTable(string sql, DataTable dt, string tableName) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); try { using (DbDataAdapter adapter = ProviderFactory.CreateDataAdapter()) { Command.CommandText = sql; adapter.SelectCommand = Command; if (dt == null) dt = new DataTable(); adapter.Fill(dt); if (!string.IsNullOrEmpty(tableName)) dt.TableName = tableName; return dt; } } finally { CloseConnection(); // Clears parameters } }
0
24. Example
View licensepublic int UpdateDataSet(DataSet ds, string sql) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (ds == null) throw new ArgumentNullException("ds", "DataSet cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.UpdateCommand = Command; adapter.UpdateCommand.CommandText = sql; return adapter.Update(ds); } finally { if (adapter.UpdateCommand != null) adapter.UpdateCommand.Dispose(); adapter.Dispose(); } }
0
25. Example
View licensepublic int InsertDataTable(DataTable dt, string sql, UpdateRowSource updateRowSource) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (dt == null) throw new ArgumentNullException("dt", "DataTable cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.InsertCommand = Command; adapter.InsertCommand.CommandText = sql; adapter.InsertCommand.UpdatedRowSource = updateRowSource; return adapter.Update(dt); } finally { if (adapter.InsertCommand != null) adapter.InsertCommand.Dispose(); adapter.Dispose(); } }
0
26. Example
View licensepublic int DeleteDataTable(DataTable dt, string sql) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (dt == null) throw new ArgumentNullException("dt", "DataSet cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.DeleteCommand = Command; adapter.DeleteCommand.CommandText = sql; return adapter.Update(dt); } finally { if (adapter.DeleteCommand != null) adapter.DeleteCommand.Dispose(); adapter.Dispose(); } }
0
27. Example
View licensepublic DataTable GetDataTable(string sql, DataTable dt, string tableName) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); try { using (DbDataAdapter adapter = ProviderFactory.CreateDataAdapter()) { Command.CommandText = sql; adapter.SelectCommand = Command; if (dt == null) dt = new DataTable(); adapter.Fill(dt); if (!string.IsNullOrEmpty(tableName)) dt.TableName = tableName; return dt; } } finally { CloseConnection(); // Clears parameters } }
0
28. Example
View licensepublic int UpdateDataSet(DataSet ds, string sql) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (ds == null) throw new ArgumentNullException("ds", "DataSet cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.UpdateCommand = Command; adapter.UpdateCommand.CommandText = sql; return adapter.Update(ds); } finally { if (adapter.UpdateCommand != null) adapter.UpdateCommand.Dispose(); adapter.Dispose(); } }
0
29. Example
View licensepublic int InsertDataTable(DataTable dt, string sql, UpdateRowSource updateRowSource) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (dt == null) throw new ArgumentNullException("dt", "DataTable cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.InsertCommand = Command; adapter.InsertCommand.CommandText = sql; adapter.InsertCommand.UpdatedRowSource = updateRowSource; return adapter.Update(dt); } finally { if (adapter.InsertCommand != null) adapter.InsertCommand.Dispose(); adapter.Dispose(); } }
0
30. Example
View licensepublic int DeleteDataTable(DataTable dt, string sql) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); if (dt == null) throw new ArgumentNullException("dt", "DataSet cannot be null."); DbDataAdapter adapter = null; try { adapter = ProviderFactory.CreateDataAdapter(); adapter.DeleteCommand = Command; adapter.DeleteCommand.CommandText = sql; return adapter.Update(dt); } finally { if (adapter.DeleteCommand != null) adapter.DeleteCommand.Dispose(); adapter.Dispose(); } }
0
31. Example
View licenseprivate int GetAllAlbums() { var rowcount = 0; var ds = new DataSet(); var connectionString = ConfigurationManager.ConnectionStrings["MusicStoreEntities"]; var factory = DbProviderFactories.GetFactory(connectionString.ProviderName); //factory: {Glimpse.Ado.AlternateType.GlimpseDbProviderFactory<System.Data.SqlClient.SqlClientFactory>} using (DbCommand cmd = factory.CreateCommand()) //cmd: {Glimpse.Ado.AlternateType.GlimpseDbCommand} { //cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SELECT * FROM Albums"; using (DbConnection con = factory.CreateConnection()) //con: {Glimpse.Ado.AlternateType.GlimpseDbConnection} { con.ConnectionString = connectionString.ConnectionString; cmd.Connection = con; IDbDataAdapter dbAdapter = factory.CreateDataAdapter(); //dbAdapter: {System.Data.SqlClient.SqlDataAdapter} not GlimpseDbDataAdapter dbAdapter.SelectCommand = cmd; dbAdapter.Fill(ds); } } rowcount = ds.Tables[0].Rows.Count; return rowcount; }
0
32. Example
View licensepublic void SqlSelectTable(string query, out ReportTable table) { DbCommand comm/n ..... /n //View Source file for more details /n }
0
33. Example
View licensepublic DataSet GetDataSet(string sql, DataSet ds, string tableName) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); try { using (DbDataAdapter adapter = ProviderFactory.CreateDataAdapter()) { Command.CommandText = sql; adapter.SelectCommand = Command; if (ds == null) ds = new DataSet(); OpenConnection(); if (string.IsNullOrEmpty(tableName)) adapter.Fill(ds); else adapter.Fill(ds, tableName); return ds; } } finally { CloseConnection(); // Clears parameters } }
0
34. Example
View licensepublic DataSet GetDataSet(string sql, DataSet ds, string tableName) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); try { using (DbDataAdapter adapter = ProviderFactory.CreateDataAdapter()) { Command.CommandText = sql; adapter.SelectCommand = Command; if (ds == null) ds = new DataSet(); OpenConnection(); if (string.IsNullOrEmpty(tableName)) adapter.Fill(ds); else adapter.Fill(ds, tableName); return ds; } } finally { CloseConnection(); // Clears parameters } }
0
35. Example
View licensepublic DataSet GetDataSet(string sql, DataSet ds, string tableName) { if (string.IsNullOrEmpty(sql)) throw new ArgumentNullException("sql", "A SQL query or stored procedure name is required"); try { using (DbDataAdapter adapter = ProviderFactory.CreateDataAdapter()) { Command.CommandText = sql; adapter.SelectCommand = Command; if (ds == null) ds = new DataSet(); OpenConnection(); if (string.IsNullOrEmpty(tableName)) adapter.Fill(ds); else adapter.Fill(ds, tableName); return ds; } } finally { CloseConnection(); // Clears parameters } }
0
36. Example
View licensepublic IEnumerable<ReportDataSource> Get(Guid reportControlId) { var key =/n ..... /n //View Source file for more details /n }
0
37. Example
View licensepublic DataTable GetTable(string table, int tenant) { try { var dataTable = new DataTable(table); var adapter = factory.CreateDataAdapter(); adapter.SelectCommand = CreateCommand("select " + Quote(table) + ".* from " + Quote(table) + GetWhere(table, tenant)); log.Debug(adapter.SelectCommand.CommandText); adapter.Fill(dataTable); return dataTable; } catch (Exception error) { log.ErrorFormat("Table {0}: {1}", table, error); throw; } }
0
38. Example
View licensepublic static DataSet ExecuteToDataSet( this DatabaseCommand databaseCommand, bool keepConnectionOpe/n ..... /n //View Source file for more details /n }
0
39. Example
View licensevoid GetDataTask(object sql) { DbConnection conn = null; try { conn = /n ..... /n //View Source file for more details /n }
0
40. Example
View licenseprivate void RunQuery() { var regexPattern = @"(?<=^([^']|'[^']*')*)(update |insert |delete |merge )"; var uhOh = Regex.Match(SqlQuery.Sql.ToLower(), regexPattern, RegexOptions.Multiline | RegexOptions.IgnoreCase).Success; var cudWarning = "WARNING! The following query appears to contain an INSERT/UPDATE/DELETE/MERGE operation, but the CUD switch was not used (which is recommended). Are you sure you want to execute this query?"; if (uhOh && !ShouldContinue(SqlQuery.Sql, cudWarning)) { WriteWarning("Not running query!"); return; } if (!ShouldProcess("Database server", "Run Query:`" + SqlQuery.Sql + "`")) { WriteWarning("Not running query!"); return; } var command = GetDbCommand(); var dataTable = new DataTable(); var adapter = ProviderFactory.CreateDataAdapter(); adapter.SelectCommand = command; using (adapter) { adapter.Fill(dataTable); } WriteVerbose("Query returned " + dataTable.Rows.Count + " rows."); var outputData = GetDataRowArrayFromTable(dataTable); ExecuteCallbackData(outputData); WriteObject(outputData); }
0
41. Example
View licenseList<TableIndex> LoadIndices(string schemaName, string tableName) { //var /n ..... /n //View Source file for more details /n }
0
42. Example
View licensepublic override bool Run() { DbConnection db = Get(); if (db == null/n ..... /n //View Source file for more details /n }
0
43. Example
View licensepublic override object Execute(Expression expression) { try { Type elem/n ..... /n //View Source file for more details /n }