当前位置: 编程技术>.net/c#/asp.net
vb.net实例代码 在访问表中遍历记录
来源: 互联网 发布时间:2014-08-30
本文导语: vb.net实例代码之遍历访问表中的记录。 代码: 代码示例: sub page_load(byval sender as object, byval e as eventargs) dim dbconn as oledbconnection dim dbcommand as oledbdataadapter dim dspagedata as new dataset dim i as long d...
vb.net实例代码之遍历访问表中的记录。
代码:
代码示例:
sub page_load(byval sender as object, byval e as eventargs)
dim dbconn as oledbconnection
dim dbcommand as oledbdataadapter
dim dspagedata as new dataset
dim i as long
dbconn = new oledbconnection( _
"provider=microsoft.jet.oledb.4.0;" _
& "data source=" _
& server.mappath("employeedatabase.mdb;"))
dbcommand = new oledbdataadapter _
("select * from employee", dbconn)
dbcommand.fill(dspagedata, _
"employee")
for i = 0 to _
dspagedata.tables("employee").rows.count - 1
'code to process record
lblmessage.text = lblmessage.text _
& "
processed record: " _
& dspagedata.tables("employee"). _
rows(i).item("id")
next
end sub
在访问表中遍历记录-www.