[求助]我的程序错误:Format of the initialization string does not conform to specification starting at index 0.
<%@ import namespace="system.data"%>
<%@ import namespace="system.data.oledb"%>
<script language="vb" runat="server">
sub page_load(sender as object,e as eventargs)
dim con as oledbconnection
dim str as string
str="microsoft.jet.oledb.4.0;data source" & server.mappath("db1.mdb")
con=new oledbconnection(str)
dim ada as oledbdataadapter
dim ds as dataset=new dataset()
dim sql as string
sql="select * from data"
ada=new oledbdataadapter(sql,con)
ada.fill(ds,"data")
dst.datasource=ds.tables("data")
dst.databind()
end sub
sub ic_click(sender as object,e as datalistcommandeventargs)
if e.commandsource.id="b1" then
dst.selectedindex=e.item.itemindex
elseif e.commandsource.id="b2"
dst.selectedindex=-1
end if
dst.databind()
end sub
</script>
<html>
<form runat="server">
<asp:datalist id="dst" runat="server" onitemcommand="ic_click">
<headertemplate>
</headertemplate>
<itemtemplate>
姓名:<%# container.dataitem("姓名")%>
<asp:linkbutton id="b1" runat="server" text="详细资料"/><br>
</itemtemplate>
<selecteditemtemplate>
姓名:<%# container.dataitem("姓名")%>
<asp:linkbutton id="b2" runat="server" text="返回"/><br>
地址:<%# container.dataitem("地址")%><br>
密码:<%# container.dataitem("密码")%><br>
邮件:<%# container.dataitem("邮件")%><br>
</selecteditemtemplate>
<footertemplate>
</footertemplate>
</asp:datalist>
</form>
</html>
问题点数:20、回复次数:0Top




