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);
相关问答:
CREATE TABLE Product(model integer,
maker varchar(20),
CONSTRAINT SAND PRIMARY KEY (model),
CONSTRAINT PANDA FOREIGN KEY (model) REFERENCES PC (model)
ON DELETE CASCADE ......
最近学习asp,当练习到连接数据库的时候,频频出错,可就是不知道错在怎么地方,请高手帮忙看看!!谢谢!
包含文件xx.asp、xxsave.asp、conn.asp以及student1.mdb和表xxgl……
xx.asp为:
<html>
<hea ......
dwr.xml:
<create creator="struts" javascript="PrisonerActionForm">
<param name="formBean" value="prisonerForm"/>
< ......
我做了一个小程序,想实现的功能就是在文本框中输入姓名,点击查询按钮,就能查到ACCESS数据库中此学生的信息(编号,姓名,性别,年龄)可我不知道语法格式,我自己写的语句调试能通过,可是运行时出错(点击查询按 ......
rt,我试了网上直连Acces数据库的方法,windows下没有问题,但是在linux下不行,谁能给点提示?谢谢
你怎么连的?
Acces数据库..
你怎么练的呢?
Java code:
static String DBDRIVER = "sun.jd ......