C# Class MySqlHelper, zcw

数据库的通用访问代码 此类为抽象类,不允许实例化,在应用时直接调用即可
Datei anzeigen Open project: jerrytan/zcw Class Usage Examples

Public Methods

Method Description
ExecuteNonQuery ( string sql ) : int

执行增删改,返回执行成功的条数

ExecuteReader ( string sql ) : System.Data.SqlClient.SqlDataReader
ExecuteScalar ( string sql ) : object

返回执行查询的首行首列

GetTable ( string sql ) : DataTable

执行查询返回DataTable

Method Details

ExecuteNonQuery() public static method

执行增删改,返回执行成功的条数
public static ExecuteNonQuery ( string sql ) : int
sql string
return int

ExecuteReader() public static method

public static ExecuteReader ( string sql ) : System.Data.SqlClient.SqlDataReader
sql string
return System.Data.SqlClient.SqlDataReader

ExecuteScalar() public static method

返回执行查询的首行首列
public static ExecuteScalar ( string sql ) : object
sql string
return object

GetTable() public static method

执行查询返回DataTable
public static GetTable ( string sql ) : DataTable
sql string
return DataTable