0
我可以使用MsgBox
顯示數據,但是我希望它將它放在div內。顯示來自數據庫內部div的數據
有人可以向我解釋我該如何做到這一點?
代碼:
Dim connetionString As String
Dim connection As SqlConnection
Dim adapter As SqlDataAdapter
Dim ds As New DataSet
Dim i As Integer
connetionString = "Data Source=Gadasini-aldigim\SQLEXPRESS;Initial Catalog=allgiz;Trusted_Connection=True"
connection = New SqlConnection(connetionString)
connection.Open()
adapter = New SqlDataAdapter("SELECT * FROM gadalar", connection)
adapter.Fill(ds)
connection.Close()
For i = 0 To ds.Tables(0).Rows.Count - 1
MsgBox(ds.Tables(0).Rows(i).Item(1))
Next
爲什麼div的?如果你想顯示錶格數據,你應該使用像GridView,ListView,Repeater,DataList或像ListBox或DropDownList這樣簡單的控件的數據綁定web控件。 –