<%@ import namespace="system.data.sqlclient" %> |
<Script runat="server"> |
Sub page_load |
Dim dbconn as sqlconnection |
Dim dbCMD as sqlCommand |
Dim dtr as sqldatareader |
dbConn = New SQLConnection ("Data Source=DBSERVERNAME;Initial Catalog=YOURDBNAME;User ID=YOURUSERID;Password=YOURPASSWORD") |
dbConn.open() |
dbCMD = new sqlcommand ("select * from tblTest",dbconn) |
dtr = dbCMD.executereader() |
While dtr.read() |
response.write ("<li>") |
response.write (dtr(0) & "---" & dtr(1)) |
End while |
dtr.close() |
dbConn.close() |
End Sub |
</Script> |
Article ID: 176, Created: July 25, 2012 at 12:46 AM, Modified: July 25, 2012 at 12:46 AM