Creates and returns a DbCommand object from the specified sqlBuilder.
Namespace: DbExtensions
Assembly: DbExtensions (in DbExtensions.dll)
public static DbCommand CreateCommand(
this DbConnection connection,
SqlBuilder sqlBuilder
)
Type: System.Data.Common.DbConnection
The connection used to create the command.
Type: DbExtensions.SqlBuilder
The SqlBuilder that provides the command's text and parameters.
Type: DbCommand
A new DbCommand object whose CommandText property is initialized with the sqlBuilder's string representation, and whose Parameters property is initialized with the values from the ParameterValues property of the sqlBuilder parameter.
In Visual Basic and C#, you can call this method as an instance method on any object of type DbConnection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Extensions Class
DbExtensions Namespace
Extensions.CreateCommand(DbConnection, String, Object[])