Class AccessTools
- Namespace
- LinqToDB.DataProvider.Access
- Assembly
- linq2db.dll
Contains Access provider management tools.
public static class AccessTools
- Inheritance
-
AccessTools
Properties
DefaultBulkCopyType
Default bulk copy mode, used for Access by BulkCopy<T>(DataConnection, IEnumerable<T>) methods, if mode is not specified explicitly. Default value: MultipleRows.
[Obsolete("Use AccessOptions.Default.BulkCopyType instead.")]
public static BulkCopyType DefaultBulkCopyType { get; set; }
Property Value
Methods
AsAccess<TSource>(ITable<TSource>)
[Sql.QueryExtension(null, Sql.QueryExtensionScope.None, typeof(NoneExtensionBuilder))]
public static IAccessSpecificTable<TSource> AsAccess<TSource>(this ITable<TSource> table) where TSource : notnull
Parameters
table
ITable<TSource>
Returns
- IAccessSpecificTable<TSource>
Type Parameters
TSource
AsAccess<TSource>(IQueryable<TSource>)
[Sql.QueryExtension(null, Sql.QueryExtensionScope.None, typeof(NoneExtensionBuilder))]
public static IAccessSpecificQueryable<TSource> AsAccess<TSource>(this IQueryable<TSource> source) where TSource : notnull
Parameters
source
IQueryable<TSource>
Returns
- IAccessSpecificQueryable<TSource>
Type Parameters
TSource
CreateDataConnection(DbConnection, string?)
Creates DataConnection object using provided connection object.
public static DataConnection CreateDataConnection(DbConnection connection, string? providerName = null)
Parameters
connection
DbConnectionConnection instance.
providerName
stringProvider name.
Returns
- DataConnection
DataConnection instance.
CreateDataConnection(DbTransaction, string?)
Creates DataConnection object using provided transaction object.
public static DataConnection CreateDataConnection(DbTransaction transaction, string? providerName = null)
Parameters
transaction
DbTransactionTransaction instance.
providerName
stringProvider name.
Returns
- DataConnection
DataConnection instance.
CreateDataConnection(string, string?)
Creates DataConnection object using provided Access connection string.
public static DataConnection CreateDataConnection(string connectionString, string? providerName = null)
Parameters
Returns
- DataConnection
DataConnection instance.
CreateDatabase(string, bool, string)
Creates new Access database file. Requires Access OLE DB provider (JET or ACE) and ADOX.
public static void CreateDatabase(string databaseName, bool deleteIfExists = false, string provider = "Microsoft.Jet.OLEDB.4.0")
Parameters
databaseName
stringName of database to create.
deleteIfExists
boolIf
true
, existing database will be removed before create.provider
stringName of OleDb provider to use to create database. Default value: "Microsoft.Jet.OLEDB.4.0".
Remarks
Provider value examples: Microsoft.Jet.OLEDB.4.0 (for JET database), Microsoft.ACE.OLEDB.12.0, Microsoft.ACE.OLEDB.15.0 (for ACE database).
DropDatabase(string)
Removes database file by database name.
public static void DropDatabase(string databaseName)
Parameters
databaseName
stringName of database to remove.
GetDataProvider(string?)
Returns instance of Access database provider.
public static IDataProvider GetDataProvider(string? providerName = null)
Parameters
providerName
string
Returns
- IDataProvider
AccessOleDbDataProvider or AccessODBCDataProvider instance.