Property | Type | Description | |
---|---|---|---|
connectionString | string |
Method | Description | |
---|---|---|
ColumnExists ( string tableName, string columnName ) : bool |
判断是否存在某表的某个字段
|
|
DbHelperSQL ( ) : System | ||
ExecuteReader ( string strSQL ) : System.Data.SqlClient.SqlDataReader |
执行查询语句,返回SqlDataReader ( 注意:调用该方法后,一定要对SqlDataReader进行Close )
|
|
ExecuteSql ( string SQLString ) : int |
执行SQL语句,返回影响的记录数
|
|
ExecuteSql ( string SQLString, string content ) : int |
执行带一个存储过程参数的的SQL语句。
|
|
ExecuteSqlByTime ( string SQLString, int Times ) : int | ||
ExecuteSqlGet ( string SQLString, string content ) : object |
执行带一个存储过程参数的的SQL语句。
|
|
ExecuteSqlInsertImg ( string strSQL, byte fs ) : int |
向数据库里插入图像格式的字段(和上面情况类似的另一种实例)
|
|
ExecuteSqlTran ( List |
执行多条SQL语句,实现数据库事务。
|
|
ExecuteSqlTran ( System |
执行多条SQL语句,实现数据库事务。
|
|
ExecuteSqlTran ( |
执行多条SQL语句,实现数据库事务。
|
|
ExecuteSqlTranWithIndentity ( |
执行多条SQL语句,实现数据库事务。
|
|
ExecuteSqlTranWithIndentity ( System |
执行多条SQL语句,实现数据库事务。
|
|
Exists ( string strSql ) : bool | ||
GetMaxID ( string FieldName, string TableName ) : int | ||
GetSingle ( string SQLString ) : object |
执行一条计算查询结果语句,返回查询结果(object)。
|
|
GetSingle ( string SQLString, int Times ) : object | ||
Query ( string SQLString ) : |
执行查询语句,返回DataSet
|
|
Query ( string SQLString, int Times ) : |
||
RunProcedure ( string storedProcName, IDataParameter parameters, string tableName ) : |
执行存储过程
|
|
RunProcedure ( string storedProcName, IDataParameter parameters, string tableName, int Times ) : |
||
RunProcedure ( string storedProcName, IDataParameter parameters ) : System.Data.SqlClient.SqlDataReader |
执行存储过程,返回SqlDataReader ( 注意:调用该方法后,一定要对SqlDataReader进行Close )
|
|
RunProcedure ( string storedProcName, IDataParameter parameters, int &rowsAffected ) : int |
执行存储过程,返回影响的行数
|
|
TabExists ( string TableName ) : bool |
表是否存在
|
Method | Description | |
---|---|---|
BuildIntCommand ( |
创建 SqlCommand 对象实例(用来返回一个整数值)
|
|
BuildQueryCommand ( |
构建 SqlCommand 对象(用来返回一个结果集,而不是一个整数值)
|
|
PrepareCommand ( |
public static ColumnExists ( string tableName, string columnName ) : bool | ||
tableName | string | 表名称 |
columnName | string | 列名称 |
return | bool |
public static ExecuteReader ( string strSQL ) : System.Data.SqlClient.SqlDataReader | ||
strSQL | string | 查询语句 |
return | System.Data.SqlClient.SqlDataReader |
public static ExecuteSql ( string SQLString ) : int | ||
SQLString | string | SQL语句 |
return | int |
public static ExecuteSql ( string SQLString, string content ) : int | ||
SQLString | string | SQL语句 |
content | string | 参数内容,比如一个字段是格式复杂的文章,有特殊符号,可以通过这个方式添加 |
return | int |
public static ExecuteSqlByTime ( string SQLString, int Times ) : int | ||
SQLString | string | |
Times | int | |
return | int |
public static ExecuteSqlGet ( string SQLString, string content ) : object | ||
SQLString | string | SQL语句 |
content | string | 参数内容,比如一个字段是格式复杂的文章,有特殊符号,可以通过这个方式添加 |
return | object |
public static ExecuteSqlInsertImg ( string strSQL, byte fs ) : int | ||
strSQL | string | SQL语句 |
fs | byte | 图像字节,数据库的字段类型为image的情况 |
return | int |
public static ExecuteSqlTran ( List |
||
SQLStringList | List |
多条SQL语句 |
return | int |
public static ExecuteSqlTran ( System |
||
cmdList | System |
|
return | int |
public static ExecuteSqlTran ( |
||
SQLStringList | SQL语句的哈希表(key为sql语句,value是该语句的SqlParameter[]) | |
return | void |
public static ExecuteSqlTranWithIndentity ( |
||
SQLStringList | SQL语句的哈希表(key为sql语句,value是该语句的SqlParameter[]) | |
return | void |
public static ExecuteSqlTranWithIndentity ( System |
||
SQLStringList | System |
SQL语句的哈希表(key为sql语句,value是该语句的SqlParameter[]) |
return | void |
public static Exists ( string strSql ) : bool | ||
strSql | string | |
return | bool |
public static GetMaxID ( string FieldName, string TableName ) : int | ||
FieldName | string | |
TableName | string | |
return | int |
public static GetSingle ( string SQLString ) : object | ||
SQLString | string | 计算查询结果语句 |
return | object |
public static GetSingle ( string SQLString, int Times ) : object | ||
SQLString | string | |
Times | int | |
return | object |
public static Query ( string SQLString ) : |
||
SQLString | string | 查询语句 |
return |
public static Query ( string SQLString, int Times ) : |
||
SQLString | string | |
Times | int | |
return |
public static RunProcedure ( string storedProcName, IDataParameter parameters, string tableName ) : |
||
storedProcName | string | 存储过程名 |
parameters | IDataParameter | 存储过程参数 |
tableName | string | DataSet结果中的表名 |
return |
public static RunProcedure ( string storedProcName, IDataParameter parameters, string tableName, int Times ) : |
||
storedProcName | string | |
parameters | IDataParameter | |
tableName | string | |
Times | int | |
return |
public static RunProcedure ( string storedProcName, IDataParameter parameters ) : System.Data.SqlClient.SqlDataReader | ||
storedProcName | string | 存储过程名 |
parameters | IDataParameter | 存储过程参数 |
return | System.Data.SqlClient.SqlDataReader |
public static RunProcedure ( string storedProcName, IDataParameter parameters, int &rowsAffected ) : int | ||
storedProcName | string | 存储过程名 |
parameters | IDataParameter | 存储过程参数 |
rowsAffected | int | 影响的行数 |
return | int |
public static TabExists ( string TableName ) : bool | ||
TableName | string | |
return | bool |