日期:2014-05-17 浏览次数:20463 次
Protected Sub Page_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conn As SqlConnection
Dim dbstring
dbstring = System.Configuration.ConfigurationManager.ConnectionStrings("connstr").ToString
conn = New SqlConnection(dbstring)
conn.Open()
Dim comm As SqlCommand
Dim sql As String
Dim dbread As SqlDataReader
sql = "select * from [table]"
comm = New SqlCommand(sql, conn)
dbread = comm.ExecuteReader()
dl1.DataSource = dbread
dl1.DataBind()
gv1.DataSource = dbread
gv1.DataBind()
End Sub