下面的代码有什么问题。我不知道如何将 sqldatabase 表格内容添加到下拉列表中请帮助
Protected Sub DropDownList3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList3.SelectedIndexChanged
Dim sqlcon As New SqlConnection("Data Source=SOf-22\SQLEXPRESS;Initial Catalog=Sales_oct_3;Persist Security Info=True;User ID=s;Password=121")
If sqlcon.State = ConnectionState.Open Then
sqlcon.Close()
End If
sqlcon.Open()
Dim strcommand As String
strcommand = "select item from tgnitem"
Dim sqlcomm As New SqlCommand(strcommand, sqlcon)
Dim o As String = sqlcomm.ExecuteNonQuery()
End Sub
End Class