如何在html表中创建checkboxlist

时间:2014-07-10 10:23:52

标签: asp.net sql database vb.net

Dim data As New SqlDataAdapter
       Dim ds As New DataSet
        Dim df As New DataTable
     Dim dt As New DataTable
      Dim cblbind As New CheckBoxList
      Dim strcon As String = ConfigurationManager.ConnectionStrings("sample").ConnectionString
        Dim con As New SqlConnection(strcon)
       Dim CmdString As String = "select Teamid,teamname from team"
       Dim cmd As New SqlCommand(CmdString, con)
       data.SelectCommand = cmd
       con.Open()
       data.SelectCommand = cmd
        data.Fill(dt)
      For i As Integer = 0 To dt.Rows.Count - 1
       cmd.Parameters.Clear()
            Dim protyp As Integer = dt.Rows(i).Item("TeamId")
            cmd.Connection = con
           cmd.CommandText = "TeamBindingProc"
           cmd.Parameters.Add("@TeamId", SqlDbType.Int).Value = protyp
           cmd.CommandType = CommandType.StoredProcedure
            data.SelectCommand = cmd
           data.Fill(ds)
            Dim HtmlStr As String = ""
           HtmlStr += "<table border='1' align='center'>"
          HtmlStr += "<tr>"
  HtmlStr += "<th>" + "TeamName" + "</th>"
         HtmlStr += "<th>" + "TeamMember" + "</th>"
 HtmlStr += "</tr>"
           For Each dr As DataRow In ds.Tables(0).Rows
               HtmlStr += "<tr>"

           ` HtmlStr += "<td>" + dr("TeamName").ToString() + "</td>"`
           ` HtmlStr += "<td>" + dr("Nickname").ToString() + "</td>"`
           ` HtmlStr += "</tr>"`
       ` Next`

       ` HtmlStr += "</table>"`
     `   literal1.Text = HtmlStr`
    `Next`
    ' Next

我在这个编码中标记为大胆我希望Checkboxlist for the Lines ..怎么做?

0 个答案:

没有答案