asp.net เรียกใช้ ค่ะAdRotator จาก Database เป็นการดึงค่า DataSoruce
Tag : - - - -
Date :
28 ม.ค. 2548 11:44:24
By :
อัญมณี
View :
2691
Reply :
1
No. 1
Guest
Code (VB.NET)
Function AdRotatorDataTable()
Dim objConn As OleDbConnection
Dim dtAdapter As OleDbDataAdapter
Dim dt As New DataTable
Dim strConnString As String
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& _
Server.MapPath("database/mydatabase.mdb")&";"
objConn = New OleDbConnection(strConnString)
objConn.Open()
Dim strSQL As String
strSQL = "SELECT * FROM banner"
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(dt)
dtAdapter = Nothing
objConn.Close()
objConn = Nothing
'*** AdRotator ***'
With Me.myAdRotator1
.DataSource = dt
.ImageUrlField = "Logo"
.AlternateTextField = "BannerName"
.DataBind()
End With
End Function