- 博客(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
1249
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
ASP组件开发相关资料
过程:
新建工程选择ActiveX DLL
将工程名改为:projectname
将类名改为:classname
将DLL的代码复制进去
生成projectname.dll文件
将projectname.dll文件复制到system32目录
运行regsvr32.exe projectname.dll
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
格式:
'该语句的作用是变量未定义而使用则报错
option explicit
'定义私有变量
private 与属性对应的变量名 as 类型
'获取属性值
public property get 属性() as 类型
属性=与属性对应的变量名
end property
'设置属性值
public property let 属性(byval 形式参数名 as 类型)
与属性对应的变量名=形式参数名
end property
'定义方法[有返回值]
public function 方法名([形式参数名 as 类型]) [as 类型]
相关代码
方法名=返回值
end function
'定义方法[无返回值]
public sub 方法名([形式参数名 as 类型])
相关代码
end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
注意:
在方法中定义变量的格式只能是:dim 变量名 as 类型
2009-08-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人