- 博客(1)
- 资源 (46)
- 收藏
- 关注
原创 .NET数据库操作简单化组件
组件参考手册:使用范例:sql_execute方法使用参考.aspxcall db.sql_execute("delete from zc_table where id=5")%>sql_insert方法使用参考.aspxdim ht as new hashtable()ht.item("zc_name")="测试"ht.item("zc_sex")="男"ht.item("zc_age")="100"call db.sql_insert("zc_table",ht)%>sql_select方法使用参考.a
2010-12-16 19:44:00 1226
asp.net操作数据库竟这样简单
<html>
<head>
<title>分页例子</title>
<!--以下是分页的样式,可以自己修改-->
<style type="text/css">
.page_size_first_page{text-decoration:none;font-size:13px;color:black;}
.page_size_prev_page{text-decoration:none;font-size:13px;color:black;}
.page_size_next_page{text-decoration:none;font-size:13px;color:black;}
.page_size_last_page{text-decoration:none;font-size:13px;color:black;}
.page_size_current_page_text{font-size:13px;color:black;}
.page_size_current_page_number{font-size:13px;color:red;}
.page_size_page_count_text{font-size:13px;color:black;}
.page_size_page_count_number{font-size:13px;color:red;}
.page_size_rs_count_text{font-size:13px;color:black;}
.page_size_rs_count_number{font-size:13px;color:red;}
.page_size_page_size_text{font-size:13px;color:black;}
.page_size_page_size_number{font-size:13px;color:red;}
.page_size_text{font-size:13px;color:black;}
</style>
</head>
<body>
<%
'获取地址栏传来的当前页码
dim current_page as string=request.querystring("current_page")
'如果当前页码为空,默认页就是第1页
if(current_page="")then:current_page="1":end if
dim dt as datatable=db.get_datatable("select * from zc_table",10,current_page)
'以上是将sql语句得出的结果按10条每页来分页,并返回指定页的结果
dim temp_start as integer
'由于dt里面只有当前页的结果,所以全部输出来就可以了
for temp_start=0 to dt.rows.count-1
%>
<%=dt.rows(temp_start)("id")%><br/>
<%
next
response.write(db.get_pagesize("index.aspx?dry_temp=0&zc_keyword=xxfaxy"))
'请更改当前文件名
'如果不需要传递参数请人为的传递一个无效参数就好了
%>
</body>
</html>
这样就完成了分页
添加 删除 修改 查询数据一句代码就搞定,简单得你不敢相信。
2011-02-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人