如何在c#中绑定数据表单dAtabase

时间:2010-07-07 11:10:38

标签: c#

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “              SelectCommand =“当len(T.hallticketno)= 1然后'0000'+转换(varchar(20),T.hallticketno)时选择大小写  当len(T.hallticketno)= 2然后'000'+转换(varchar(20),T.hallticketno)  当len(T.hallticketno)= 3然后'00'+转换(varchar(20),T.hallticketno)  当len(T.hallticketno)= 4然后'0'+转换(varchar(20),T.hallticketno)  当len(T.hallticketno)= 5然后转换(varchar(20),T.hallticketno)结束为Hallticketno ,T.Studentname,(从senseimaster中选择senseiname,其中senseiid = T.senseiID)作为SenseiName,(从kyumaster选择kyuname,其中kyuid = T.kyuid)作为Kyu,(从groupmaster中选择groupname = groupid = T.groupid)作为GroupName, T.Fathername,转换(varchar(20),T.dob,103)为Dob,当T.sex = 0然后'男'其他'女'结尾为性别 来自applicationForm T,其中Franchiseid = @ FRANCHISEID和Competitionid = @ competitionId 按组名称排序“>         - %GT;                                公司名称的                  城市的                                                                                                                                       - %GT;
<table id ="sample " border ="1px" visible ="false" >    
    <tr>
    <asp:Label ID="Label13" runat ="server" Font-Bold="true" Text ='<%#Bind(CompetitionName)%>' ></asp:Label><td style="width: 100px">            
        </td>
        <td style="width: 106px">
        </td>
        <td style="width: 127px">
        </td>
        <td style="width: 129px">
        </td>
    </tr>     
    <tr>
        <td style="width: 100px">
            Venue</td>
        <td style="width: 106px">
        <asp:Label ID="Label14" runat ="server" Font-Bold="true" Text ='<%Bind(competitionaddress) %>'  ></asp:Label>
        </td>
        <td style="width: 127px">
            Date of Competition</td>
        <td style="width: 129px">
        <asp:Label ID ="Label15" runat ="server" ></asp:Label>
        </td>
    </tr>
    <tr>
        <td style="width: 100px">
            Hall Ticket No</td>
        <td style="width: 106px">
        <asp:Label Font-Bold="true" Font-Size="X-Large"  ID="Label16" runat="server"  ></asp:Label> 
        </td>
        <td style="width: 127px">
            Group</td>
        <td style="width: 129px">
        <asp:Label ID="Label17" runat="server"  Font-Bold="true"></asp:Label>
        <%--<asp:Label ID="Lable1" runat ="server" Font-Bold="true"  Text ='<%Bind("GroupName")%>'></asp:Label>--%>
        </td>
    </tr>
    <tr>
        <td style="width: 100px">
            Student Name</td>
        <td style="width: 106px">
        <asp:Label  ID ="Lable18" runat ="server" ></asp:Label>
        </td>
        <td style="width: 127px">
            Kyu</td>
        <td style="width: 129px">
        <asp:Label ID="Lable19" runat ="server" ></asp:Label>
        </td>
    </tr>
    <tr>
        <td rowspan="3" style="width: 100px">
        </td>
        <td style="width: 106px">
        <asp:Label ID ="Lable20" runat ="server" ></asp:Label>
        </td>
        <td style="width: 127px">
            Franchise Name</td>
        <td style="width: 129px">
        <asp:Label ID ="Lable21" runat ="server" ></asp:Label>
        </td>
    </tr>
    <tr>
        <td style="width: 106px">
        </td>
        <td style="width: 127px">
            Sensei's Name</td>
        <td style="width: 129px">
        <asp:Label ID ="Lable22" runat ="server" ></asp:Label>
        </td>
    </tr>
    <tr>
        <td style="width: 106px">
        </td>
        <td style="width: 127px">
        </td>
        <td style="width: 129px">
        </td>
    </tr>
    <tr>
        <td style="width: 100px">
        </td>
        <td style="width: 106px">
            Signature of HO</td>
        <td style="width: 127px">
        </td>
        <td style="width: 129px">
            Signature of Student</td>
    </tr>
</table>


<%--</asp:Repeater> --%>

如果我点击Hall Ticket然后数据sholud被绑定到特定领域...如何做朋友PLZ帮助我...

1 个答案:

答案 0 :(得分:0)

您必须使用支持DataBind的控件,将表封装起来,就像FormView一样。