易截截图软件、单文件、免安装、纯绿色、仅160KB

dOOdads 连接 ACCESS 的数据分页问题

如题 dOOdads 连接 ACCESS 的数据分页问题!

使用 dOOdads 连接 ACCESS数据的时候 数据分页的问题!
根据这个改吧
C# code:

public static Product[] SearchProducts(string keyword, int categoryID, int pageSize, int pageIndex, out int total)
{
OleDbConnection connection = new OleDbConnection(ConnectionString);
// 建立查询,查出满足条件产品的总数
OleDbCommand countCommand = connection.CreateCommand();
countCommand.CommandText = "SELECT COUNT(ProductID) from tblProducts ";

string where = "WHERE Active > 0 ";
if (categoryID > 0)
{
where = where + "AND CategoryID = " + categoryID.ToString() + " ";
}

if (!string.IsNullOrEmpty(keyword))
{
where = where + "AND ProductName LIKE '%" + keyword + "%' ";
}
countCommand.CommandText += where;

DataTable dt = new DataTable();
try
{
connection.Open();
total = (int)countCommand.ExecuteScalar();

if (total < 1) return null; // 没有记录返回空(null)

int maxPageNum = (total % pageSize == 0 ? total / pageSize : total / pageSize + 1);


相关问答:

Dbgrid连接access拖动滚动条死机?

Dbgrid连接access 显示数据时拖动滚动条死机?怎么解决啊?
机器太差了吧?

是不是你数据量太大了啊
你数据少一些看看还死机吗?

数据很少啊 就一页。

我在BCB6下做过不少 DBGRID+ACCESS ,从来没有遇到 ......

asp连接ACCESS数据库的问题!!

最近学习asp,当练习到连接数据库的时候,频频出错,可就是不知道错在怎么地方,请高手帮忙看看!!谢谢!
包含文件xx.asp、xxsave.asp、conn.asp以及student1.mdb和表xxgl……
xx.asp为:
<html>
<hea ......

关于ACCESS和MSSQL的问题 - Web 开发 / ASP

有一个数据库里只有2W条数据不到,却有500M那么大,怎么回事啊?是ACCESS的数据库。后来我把ACCESS导入到MSSQL中,也占用了500M左右的空间,如果压缩数据库呢?请高手指点
压缩数据库?能做到么...
期待高人指点 我 ......

dwr Illegal access to default constructor错误

dwr.xml:
<create creator="struts" javascript="PrisonerActionForm">
  <param name="formBean" value="prisonerForm"/>
  < ......

得到access数据库的名字列表

得到access数据库的名字列表:
一、查询access数据库中所有的数据库名称,SQL语句怎么写?
二、查询某个数据库中所有的表名,SQL语句怎么写?
三、如何写查询数据表的列结构的详细信息的SQL语句?如:该列是否为空 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号