为什么不管在dropdownlist1控件中选那一项,只要点击button1按钮,得到的都是第一项的值,不点击button1的时候,测试绑定完全正常,(第一项对应第一项的值,第二项对应第二项的值.......)Imports System.Data
Imports System.Data.oledb
Public Class login1
    Inherits System.Web.UI.Page#Region " Web 窗体设计器生成的代码 "    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()    End Sub
    Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
    Protected WithEvents Button2 As System.Web.UI.WebControls.Button
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected WithEvents DropDownList1 As System.Web.UI.WebControls.DropDownList
    Protected WithEvents Button11 As System.Web.UI.WebControls.Button
    '注意: 以下占位符声明是 Web 窗体设计器所必需的。
    '不要删除或移动它。
    Private designerPlaceholderDeclaration As System.Object
    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
        '不要使用代码编辑器修改它。
        InitializeComponent()
    End Sub
#End Region
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            Dim sql As String
            Dim conn As New conclass.conclass
            conn.con1.Open()
            sql = "select name from admin order by id"
            Dim mycommand As New OleDbDataAdapter(sql, conn.con1)
            Dim dataset11 As New DataSet
            mycommand.Fill(dataset11, "admin")
            DropDownList1.DataSource = dataset11.Tables("admin").DefaultView
            DropDownList1.DataTextField = "name"
            DropDownList1.DataValueField = "name"
            DropDownList1.DataBind()
            conn.con1.Close()
        End If
        '在此处放置初始化页的用户代码
    End Sub
    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        Dim passwords1, sql As String
        Dim name1 As String
        passwords1 = TextBox2.Text.ToString.Trim
        name1 = DropDownList1.SelectedItem.Text
        If passwords1 = "" Then
            Response.Write("<script language=javascript>alert('密码不得为空!!!')</script>")
        Else
            Dim conn As New conclass.conclass
            conn.con1.Open()
            sql = "select top 1 [id],[name],[password] from [admin] where [name]= '" & name1 & "' and [password]='" & passwords1 & "'"
            Dim reader1 As New OleDbDataAdapter(sql, conn.con1)
            Dim dataset11 As New DataSet
            reader1.Fill(dataset11, "admin")
            If dataset11.Tables("admin").Rows.Count = 0 Then
                TextBox2.Text = ""
                Session("flag") = False
                Response.Write("<script language=javascript>alert('密码错误!!!')</script>")
            ElseIf dataset11.Tables("admin").Rows.Count = 1 Then
                Session("flag") = True
                Session("users") = DropDownList1.SelectedItem.Value.ToString.Trim
                Response.Redirect("adminmaillist.aspx")
            End If
        End If
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        TextBox2.Text = ""
    End Sub
End Class