using System; using System.Data.Common; using System.Data.OleDb; namespace System.Data.Jet { /// /// Jet provider factory /// public class JetProviderFactory : DbProviderFactory { public static readonly JetProviderFactory Instance = new JetProviderFactory(); /// /// Specifies whether the specific supports the class. /// public override bool CanCreateDataSourceEnumerator { get { return false; } } /// /// Returns a new instance of the provider's class that implements the class. /// /// /// A new instance of . /// public override DbCommand CreateCommand() { return new JetCommand(); } /// /// Returns a new instance of the provider's class that implements the class. /// /// /// A new instance of . /// public override DbCommandBuilder CreateCommandBuilder() { OleDbCommandBuilder commandBuilder = new OleDbCommandBuilder(); commandBuilder.QuotePrefix = "["; commandBuilder.QuoteSuffix = "]"; return commandBuilder; } /// /// Returns a new instance of the provider's class that implements the class. /// /// /// A new instance of . /// public override DbConnection CreateConnection() { return new JetConnection(); } /// /// Returns a new instance of the provider's class that implements the class. /// /// /// A new instance of . /// public override DbConnectionStringBuilder CreateConnectionStringBuilder() { OleDbConnectionStringBuilder oleDbConnectionStringBuilder = new OleDbConnectionStringBuilder(); return oleDbConnectionStringBuilder; } /// /// Returns a new instance of the provider's class that implements the class. /// /// /// A new instance of . /// public override DbDataAdapter CreateDataAdapter() { return new OleDbDataAdapter(); } /// /// Returns a new instance of the provider's class that implements the class. /// /// /// A new instance of . /// public override DbDataSourceEnumerator CreateDataSourceEnumerator() { return null; } /// /// Returns a new instance of the provider's class that implements the class. /// /// /// A new instance of . /// public override DbParameter CreateParameter() { return new OleDbParameter(); } /// /// Returns a new instance of the provider's class that implements the provider's version of the class. /// /// One of the values. /// /// A object for the specified . /// public override System.Security.CodeAccessPermission CreatePermission(System.Security.Permissions.PermissionState state) { return new OleDbPermission(state); } } }