Thanks a lotHello,
the easiest way to do this is just to put a listbox server control on your webform and then write the following code in the 'PageLoad'-event.
sub Page_LoadHTH,
dim dbconn,sql,dbcomm,dbread
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("YourDatabase.mdb"))
dbconn.Open()
sql="SELECT * FROM YourTableName"
dbcomm=New OleDbCommand(sql,dbconn)
dbread=dbcomm.ExecuteReader()
YourListbox.DataSource=dbread
YourListbox.DataBind()
dbread.Close()
dbconn.Close()
end sub
0 comments:
Post a Comment