【发布时间】:2014-07-09 04:32:22
【问题描述】:
我想创建一个 html 表格。该表包含 2 列,例如 teamName、TeamMember。
TeamName 列(如 label)和 Teammember 列(如 checkboxlist)。
如何创建和绑定?
在 aspx 页面中我的代码喜欢
<table id="table1" border="1" align="center">
<tr>
<th>
TeamName
</th>
<th>
TeamMember
</th>
</tr>
<tr>
<td>
<asp:Label ID="lbl1" runat="server"></asp:Label>
</td>
<td>
<asp:CheckBoxList ID="cblbind" runat="server">
</asp:CheckBoxList>
</td>
</tr>
</table>
如何绑定这些表?
在数据库中我的程序:
alter procedure TeamBindingProc
@teamid as int
as
begin
select Teamid,TeamName from Team
select UserId,TeamID,(select Nickname From [user] where [user].userid=TeamDetails.Userid)as Nickname from TeamDetails where Teamid=@teamid
end
【问题讨论】:
-
Dim data As New SqlDataAdapter Dim ds As New DataSet Dim df As New DataTable Dim tr As New HtmlTableRow Dim td3 As New HtmlTableCell Dim td4 As New HtmlTableCell Dim lbl As New Label Dim dt As New DataTable Dim cblbind As New CheckBoxList Dim strcon As String = ConfigurationManager.ConnectionStrings("KRGCbiz").ConnectionString Dim con As New SqlConnection(strcon) Dim CmdString As String = "select Teamid,teamname from team" Dim cmd As New SqlCommand(CmdString, con)
标签: asp.net sql database vb.net