Code Conventions

To maintain similarity and familiarity across .NET Framework data providers, use the following code conventions.

Naming Conventions

To maintain consistency across .NET Framework data providers, preface the classes implemented in your .NET Framework data provider with an identifier that is unique for your implementation. For example, a sample .NET Framework data provider might use "Sample" as a unique identifier and implement IDbConnection as "SampleConnection", IDbCommand as "SampleCommand", IDataAdapter as "SampleDataAdapter", and so on.

Constructors

Although not a required part of the implementation of the ADO.NET interfaces, there is a standard set of constructors that should be implemented in each .NET Framework data provider to help ensure a consistent programming model. The following table lists the constructors that should be implemented in every .NET Framework data provider. In the constructor names listed, Prv is a placeholder for the unique identifier for your class name.

Interface Constructors
IDbConnection
PrvConnection() PrvConnection(string connectionString)
IDbTransaction None.
IDbCommand
PrvCommand() PrvCommand(string cmdText) PrvCommand(string cmdText, PrvConnection connection) PrvCommand(string cmdText, PrvConnection connection, PrvTransaction transaction)
IDataParameter
PrvParameter() PrvParameter(string name, PrvDbType dataType) PrvParameter(string name, object value) PrvParameter(string name, PrvDbType dataType, int size) PrvParameter(string name, PrvDbType dataType, int size, string srcColumn) PrvParameter(string name, PrvDbType dbType, int size, ParameterDirection direction, Boolean isNullable, Byte precision, Byte scale, string srcColumn, DataRowVersion srcVersion, object value)
IDataParameterCollection
PrvParameterCollection()
IDataReader None.
IDataAdapter
PrvDataAdapter() PrvDataAdapter(PrvCommand selectCommand) PrvDataAdapter(string selectCommandText, string selectConnectionString) PrvDataAdapter(string selectCommandText, PrvConnection selectConnection)
IDbDataAdapter
PrvDataAdapter() PrvDataAdapter(PrvCommand selectCommand) PrvDataAdapter(string selectCommandText, string selectConnectionString) PrvDataAdapter(string selectCommandText, PrvConnection selectConnection)

See Also

Implementing a .NET Framework Data Provider | Getting Started with a .NET Framework Data Provider Implementation | Sample .NET Framework Data Provider