统计有多少个学生
2014-10-24 23:24:54 访问(2370) 赞(0) 踩(0)
-
提示:单表操作,对数据库方法的使用
-
select count(1) from UTB_EXAM_STUDENT
-
/// <summary>
///
/// </summary>
/// <param name="xdbHelper"></param>
protected void DataBindTheContorls(DBHelper xdbHelper)
{
string theResult=null;
bool bIsCreate = true;
if (xdbHelper == null)
{
xdbHelper = SlowX.DAL.Helpers.DBHelper.CreateDBHelper();
}
else
{
// 没有打开链接 //
bIsCreate = xdbHelper.IsNotOpen();
}
try
{
if (bIsCreate)
xdbHelper.OpenDBHelper();
SlowX.ExamLib.Business.UTB_EXAM_STUDENT
bll
=
SlowX.ExamLib.Business.UTB_EXAM_STUDENT.instance;
SlowX.ExamLib.Entity.UTB_EXAM_STUDENT
entity
=
new SlowX.ExamLib.Entity.UTB_EXAM_STUDENT();
int iCount = bll.Count(entity, xdbHelper);
theResult = iCount.ToString();
if (bIsCreate)
xdbHelper.EndDBHelper();
}
catch (Exception err)
{
if (bIsCreate)
xdbHelper.TranDBHelper();
throw err;
}
finally
{
if (bIsCreate)
xdbHelper.FinallyDBHelper();
}
strResult = theResult;
}
标签:
数据库练习统计有多少个学生 


上一条:
下一条:
相关评论
发表评论