asp.net oledbconnection problem
i'm operative an asp.net website where i am controlling an asp:repeater paging finished by vb.net code-behind file. i'm carrying problem database tie though. distant i tell, paging working, nonetheless i can't information certain.
the database microsoft opening database. duty should accessing database is:
dim pageddata new pageddatasource
sub page_load(byval obj object, byval e eventargs)
dopaging()
end sub
function getthedata() datatable
low ds new dataset()
low strconnect new oledbconnection("provider = microsoft.jet.oledb.4.0;data source=app_data/artdatabase.mdb")
low objoledbadapter new oledbdataadapter("select artid, filelocation, title, username, artdate art method art.artdate desc", strconnect)
objoledbadapter.fill(ds, "art")
relapse ds.tables("art").copy
end function
sub dopaging()
pageddata.datasource = getthedata().defaultview
pageddata.allowpaging = true
pageddata.pagesize = 2
try
pageddata.currentpageindex = int32.parse(request.querystring("page")).tostring()
locate ex exception
pageddata.currentpageindex = 0
finish try
btnprev.visible = (not pageddata.isfirstpage)
btnnext.visible = (not pageddata.islastpage)
pagenumber.text = (pageddata.currentpageindex + 1) & " " & pageddata.pagecount
artrepeater.datasource = pageddata
artrepeater.databind()
end sub
the asp.net is:
<asp:repeater id="artrepeater" runat="server">
<headertemplate>
<h2>items comparison category:</h2>
</headertemplate>
<itemtemplate>
<li>
<asp:hyperlink runat="server" id="hyperlink"
navigateurl='<%# eval("artid", "artpiece.aspx?artid={0}") %>'>
<img src="<%# eval("filelocation") %>"
alt="<%# databinder.eval(container.dataitem, "title") %>t"/> <br />
<%# databinder.eval(container.dataitem, "title") %>
</asp:hyperlink>
</li>
</itemtemplate>
</asp:repeater>
Comments
Post a Comment