|
我把代码贴出来了,各位看一下是哪错了???
If Not IsPostBack Then
Dim astr As String
astr = "select authername from picture"
Dim cmd1 As New SqlCommand(astr, conn)
conn.Open()
Dim adp As New SqlDataAdapter(cmd1)
Dim ds As New DataSet
adp.Fill(ds, "picture")
DropDownList1.DataSource = ds.Tables(0).DefaultView
DropDownList1.DataBind()
DropDownList1.DataTextField = "authername"
DropDownList1.DataValueField = "pid"
conn.Close()
End If |
|