Database Connection Not Working with ASP:Repeater Control. Help
ASP.NET VB.NET
Database Connection Not Working with ASP:Repeater Control. Help
hotwebideas
09-15-2006, 10:36 PM
For you ASP.NET experts, this is driving me crazy. If anyone can give me some directions, that would be great. This was working fine with classic ASP. So, I know my DSN is setup correctly.
I get the ole:
Server Error in '/' Application.
error
I have a DB connection set up in my server form:
sub page_load
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("DATABASENAME"))
dbconn.Open()
sql="select html from text_links where category='sports'"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
textlinks.DataSource=dbread
textlinks.DataBind()
dbread.Close()
dbconn.Close()
end sub
My ASP.NET Repeater Control:
<form runat=:server">
<asp:repeater runat="server" id="textlinks">
<ItemTemplate>
<%#Container.DataItem("html")%><br />
</ItemTemplate>
</asp:repeater>
</form>
Thanks to all who can answer this,
Bruce
webhost4life.com