示例#1
0
 /// <summary>
 /// 执行查询,并返回查询所返回的结果集中第一行的第一列。忽略其他列或行。
 /// </summary>
 /// <param name="cmdText">sql语句</param>
 /// <param name="dbParameter">参数集合</param>
 /// <returns>受影响的行数</returns>
 protected object ExecuteScalar(string cmdText, SqlParameterCollection dbParameter)
 {
     return(this.ExecuteScalar(CommandType.Text, cmdText, dbParameter));
 }
示例#2
0
 /// <summary>
 /// 执行数据库操作返回结果集
 /// </summary>
 /// <param name="cmdText">sql语句</param>
 /// <param name="dbParameter">参数集合</param>
 /// <returns>受影响的行数</returns>
 protected SqlDataReader ExecuteReader(string cmdText, SqlParameterCollection dbParameter)
 {
     return(this.ExecuteReader(CommandType.Text, cmdText, dbParameter));
 }
示例#3
0
 /// <summary>
 /// 执行数据库操作返回DataTable
 /// </summary>
 /// <param name="cmdText">sql语句</param>
 /// <param name="dbParameter">参数集合</param>
 /// <returns>DataTable</returns>
 public DataTable ExecuteTable(string cmdText, SqlParameterCollection dbParameter)
 {
     return(this.ExecuteTable(CommandType.Text, cmdText, dbParameter));
 }