0

网格视图中的下拉菜单

<asp:TemplateField HeaderText="ProjectModifiedBy" HeaderStyle-BackColor="#C0C0C0" HeaderStyle-BorderColor="Black">
        <ItemTemplate>
              <asp:DropDownList ID="DropDownList1" Width="99%" runat="server">
            </asp:DropDownList>
         </ItemTemplate>                 
    </asp:TemplateField>

网络方法代码

     <WebMethod()> _
Public Function BindDropDown() As SqlDataReader
    Dim strConnString As String = ConfigurationManager.ConnectionStrings("conString").ConnectionString
    Dim sqlQuery As String

    sqlQuery = "Sp_SelectEmpName"
    Dim con As New SqlConnection(strConnString)
    Dim cmd As New SqlCommand(sqlQuery, con)
    cmd.CommandType = CommandType.StoredProcedure
    Dim reader As SqlDataReader
    con.Open()
    reader = cmd.ExecuteReader()

    Return reader
End Function

这是调用webmethod的方法背后的代码,我应该在这里写什么来将empname列数据与gridview的下拉列表绑定

  Private Sub BindDataDropDown()

  End Sub
4

0 回答 0