First asp.net page - debugging help
Date: 12/23/05
(Asp Dot Net) Keywords: database, asp, sql, microsoft
I'm working on my first asp.net page and am running into some problems. I'm trying to read data from an MS Access database. I'd appreciate if anyone could point me in the right direction - I pretty much lifted the example code from w3schools. Thanks for any help, I'm feeling a bit lost!
The code below gives an error on line 4, character 5 - expected ";".
[%@ Import Namespace="System.Data.OleDb" %>
[script runat="server">
sub Page_Load
dim dbconn, dbcomm, dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=test.mdb")
dbconn.Open()
sql="SELECT * FROM values"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
value.DataSource=dbread
value.DataBind()
dbread.Close()
dbconn.Close()
end sub
[/script>
Database:
filename: test.mdb, resides in same directory as index.asp file.
table: values
fields: ID, key, value
read [s as <.
Source: http://www.livejournal.com/community/aspdotnet/52113.html