Imports System.data
Imports System.data.sqlclient
Imports ADODB
Public Class WebForm1
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
Dim conn As SqlConnection
Dim ConnectionString As String = "server=localhost.;database=test;uid=sa;pwd= ;"
conn = New SqlConnection(ConnectionString)
Dim sql As String = "SELECT * From test"
Dim myCommand As SqlCommand
Dim myDataDeader As SqlDataReader
myCommand = New SqlCommand(sql, conn)
conn.Open()
myDataDeader = myCommand.ExecuteReader
While myDataDeader.Read()
Dim i As Integer
For i = 0 To myDataDeader.FieldCount - 1
Label1.Text &= myDataDeader.Item(i)
Next
End While
conn.Close()
End Sub
请问如何改
?