Show / Hide Table of Contents

# Class DbConnectionOriginalExtension

##### Inheritance

System.Object
DbConnectionOriginalExtension

##### Inherited Members

System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Mellivora

###### Assembly: cs.temp.dll.dll

##### Syntax

    public static class DbConnectionOriginalExtension

### Methods

#### ExecuteNonQuery(IDbConnection, String)

通过ExecuteNonQuery方式来操作数据

##### Declaration

    public static int ExecuteNonQuery(this IDbConnection connection, string commandText)

##### Parameters

Type | Name | Description
--- | --- | ---
IDbConnection | connection | 对IDbConnection扩展
System.String | commandText | SQL语句

##### Returns

Type | Description
--- | ---
System.Int32 | 影响行数

#### ExecuteScalar(IDbConnection, String)

通过ExecuteScalar方式来操作数据

##### Declaration

    public static object ExecuteScalar(this IDbConnection connection, string commandText)

##### Parameters

Type | Name | Description
--- | --- | ---
IDbConnection | connection | 对IDbConnection扩展
System.String | commandText | SQL语句

##### Returns

Type | Description
--- | ---
System.Object | 数据库返回结果

#### ExecuteScalar<T>(IDbConnection, String)

通过ExecuteScalar方式来操作数据

##### Declaration

    public static T ExecuteScalar<T>(this IDbConnection connection, string commandText)

##### Parameters

Type | Name | Description
--- | --- | ---
IDbConnection | connection | 对IDbConnection扩展
System.String | commandText | SQL语句

##### Returns

Type | Description
--- | ---
T | 数据库返回结果

##### Type Parameters

Name | Description
--- | ---
T | 返回类型

#### GetCollection<T>(IDbConnection, String)

执行Sql语句并返回结果

##### Declaration

    public static IEnumerable<T> GetCollection<T>(this IDbConnection connection, string commandText)

##### Parameters

Type | Name | Description
--- | --- | ---
IDbConnection | connection | 对IDbConnection进行扩展
System.String | commandText | Sql语句

##### Returns

Type | Description
--- | ---
System.Collections.Generic.IEnumerable<T> | 结果集

##### Type Parameters

Name | Description
--- | ---
T | 返回类型

#### GetCollection<T>(IDbConnection, String, Int32, Int32)

执行Sql语句并返回结果

##### Declaration

    public static IEnumerable<T> GetCollection<T>(this IDbConnection connection, string commandText, int startField, int length)

##### Parameters

Type | Name | Description
--- | --- | ---
IDbConnection | connection | 对IDbConnection进行扩展
System.String | commandText | Sql语句
System.Int32 | startField | reader起始列
System.Int32 | length | 从起始列继续向后查询列的个数

##### Returns

Type | Description
--- | ---
System.Collections.Generic.IEnumerable<T> | 结果集

##### Type Parameters

Name | Description
--- | ---
T | 返回类型