本文整理汇总了C#中Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet方法的典型用法代码示例。如果您正苦于以下问题:C# Database.ExecuteDataSet方法的具体用法?C# Database.ExecuteDataSet怎么用?C# Database.ExecuteDataSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Practices.EnterpriseLibrary.Data.Database
的用法示例。
在下文中一共展示了Database.ExecuteDataSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataTableQuery
/// <summary>
/// 执行查询语句,返回DataTable
/// </summary>
/// <param name="dc">查询语句</param>
/// <param name="db">操作目标数据库</param>
/// <returns>DataTable</returns>
public static DataTable DataTableQuery(DbCommand dc, Database db)
{
DataSet ds = new DataSet();
DataTable dt = new DataTable();
try
{
PrepareCommand(ref dc, db);
ds = db.ExecuteDataSet(dc);
if (ds.Tables.Count > 0)
{
dt = ds.Tables[0];
ds.Dispose();
ds = null;
}
else
{
ds.Dispose();
ds = null;
return null;
}
}
catch (System.Exception e)
{
throw new Exception(e.Message);
}
return dt;
}
示例2: ExecuteDataSet
/// <summary>
/// 获取一个DataSet数据集
/// </summary>
/// <param name="cmdType">命令类型,SQL文本或存储过程</param>
/// <param name="cmdText">SQL语句或存储过程名称</param>
/// <param name="paras">查询参数</param>
/// <returns>DataSet数据集</returns>
public static DataSet ExecuteDataSet(Database db, DbTransaction dbTransaction, CommandType cmdType, string cmdText, params DbParameter[] paras)
{
DbCommand dbcmd = GetDbCommand(db, cmdType, cmdText);
PrepareDbCommand(dbcmd, paras);
DataSet ds = db.ExecuteDataSet(dbcmd, dbTransaction);
return ds;
}
示例3: GetAll
public DataSet GetAll(string OrderBy, Database db)
{
orderBy = "";
if (OrderBy.Length > 0) orderBy = " Order By " + OrderBy;
sqlText="Select ID,ACIKLAMA from SECENEK_TIP "+orderBy;
dbComm = db.GetSqlStringCommand(sqlText);
return db.ExecuteDataSet(dbComm);
}
示例4: GetAllOperateLogs
public static DataSet GetAllOperateLogs(Database db)
{
string cmdText = string.Format("select * from OperateLog order by Id");
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例5: GetAllUsers
public static DataSet GetAllUsers(Database db)
{
string cmdText = string.Format("select [userID] as 索引号, [username] as 用户名, [usertypename] as 用户类型, [createdatetime] as 创建时间 from [userinfo] order by [userId]");
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例6: GetWindowCameraInfoById
public static DataSet GetWindowCameraInfoById(Database db, int id)
{
string cmdText = string.Format("select * from [WindowCameraInfo] where [Id]={0}", id);
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例7: GetWindowCameraInfoByRowCol
public static DataSet GetWindowCameraInfoByRowCol(Database db, int row, int col)
{
string cmdText = string.Format("select * from [WindowCameraInfo] where [row]={0} and [col]={1}", row, col);
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例8: GetSystemLogs
public static DataSet GetSystemLogs(Database db, string filter)
{
string cmdText = string.Format("select ID as 索引号, happentime as 发生时间,clientusername as 用户名, systemtypename as 操作类型, content as 内容 from SystemLog {0} order by Id", filter);
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例9: GetAllWindowCameraInfo
public static DataSet GetAllWindowCameraInfo(Database db)
{
string cmdText = string.Format("select * from [WindowCameraInfo] order by [Id]");
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例10: GetSystemLogTypes
public static DataSet GetSystemLogTypes(Database db)
{
string cmdText = string.Format("select distinct systemtypename from SystemLog");
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例11: GetUserInfo
public static DataSet GetUserInfo(Database db,int userid)
{
string cmdText = string.Format("select * from [UserInfo] where [UserId]={0}", userid);
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例12: ExecuteGeneralSplitPageProcedure
public static DataSet ExecuteGeneralSplitPageProcedure(Database db, string fields,string tables,string condition, string ordercolumn,byte ordertype,string pkcolumn,int pageno,int pagesize)
{
string cmdText = string.Format("exec GeneralSplitPageProcedure {0},'{1}','{2}','{3}','{4}',{5},'{6}',{7}", pageno, fields, tables, condition, ordercolumn, ordertype, pkcolumn, pagesize);
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例13: GetAllDeviceInfo
public static DataSet GetAllDeviceInfo(Database db)
{
string cmdText = string.Format("select * from DeviceInfo order by DeviceId");
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例14: GetCapturePicture
public static DataSet GetCapturePicture(Database db, int cameraId, DateTime dt)
{
string cmdText = string.Format("select * from CapturePicture where CameraID={0} and Datetime={1}", cameraId,dt);
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}
示例15: GetGroupInfoByGroupName
public static DataSet GetGroupInfoByGroupName(Database db, string groupName)
{
string cmdText = string.Format("select * from GroupInfo where Name='{0}' ", groupName);
try
{
return db.ExecuteDataSet(CommandType.Text, cmdText);
}
catch (Exception ex)
{
throw ex;
}
}