Table of Contents

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

BulkCopyType

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 DbConnection

Connection instance.

providerName string

Provider 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 DbTransaction

Transaction instance.

providerName string

Provider 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

connectionString string

Connection string.

providerName string

Provider name.

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 string

Name of database to create.

deleteIfExists bool

If true, existing database will be removed before create.

provider string

Name 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 string

Name 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.