我用的是VB。NET哪位高手给出代码呀,谢谢谢谢。我实在是做不出来啊。

解决方案 »

  1.   

    记录一 (checkbox)  记录二 (checkbox).... 记录十(checkbox)记录十一(checkbox)selece 字段 from table 循环 I记录(I ) checkbox//逢10换行循环结束
      

  2.   

    string test;
    int j=0;
    for(int i=0;i<dt.rows.count;i=i+10)
    {
      test="记录一"+dt.row(i+1)("字段")+"记录二"+dt.row(i+2)("字段")+".........";
    }
      

  3.   

    ..........这样儿的话,最好用DataList
    DataList,有一个RepeatDirection属性可以设置绑定数据是横向排列还是竖向排死
    还有一个RepeatColumns可以设置横向显示的列数。
      

  4.   

    我这个市.net 2.0下的例子
    你把
    System.Configuration.AppSettingsReader app = new AppSettingsReader();
            Conn.ConnectionString = app.GetValue("ConnString", typeof(string)).ToString();
    这个换成你的联接串就可以了
    前台:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <table id="auTable" runat="server" border="1">
            
            </table>
        </div>
        </form>
    </body>
    </html>
    后台:
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;public partial class Default2 : System.Web.UI.Page
    {    private void bindAuthors()
        {
            SqlConnection Conn = new SqlConnection();
            System.Configuration.AppSettingsReader app = new AppSettingsReader();
            Conn.ConnectionString = app.GetValue("ConnString", typeof(string)).ToString();
            Conn.Open();
            string sql = "select phone from authors";
            SqlDataAdapter ada = new SqlDataAdapter();
            SqlCommand com = new SqlCommand(sql, Conn);
            ada.SelectCommand = com;
            DataSet ds = new DataSet();        ada.Fill(ds, "authors");
            if(ds.Tables["authors"].Rows.Count>0)
            {
                DataTable dt ;
                HtmlTableRow tr;
                HtmlTableCell tc;
                CheckBox cb;
                dt = ds.Tables["authors"];
                for (int i = 0; i < dt.Rows.Count; i = i + 10)
                {
                    tr = new HtmlTableRow();
                    
                    for (int j = 0; j < 10; j++)
                    {
                        tc = new HtmlTableCell();
                        cb = new CheckBox();
                        tc.InnerText = dt.Rows[i][0].ToString();
                        tc.Controls.Add(cb);
                        tr.Cells.Add(tc);
                    }
                    auTable.Rows.Add(tr);
                }
            }
            //GridView1.DataSource = ds.Tables["authors"].DefaultView;
            //GridView1.DataBind();
        }    protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                bindAuthors();
            }
        }
    }
      

  5.   

    给你一个类似的页面,把table换一下checkbox就可以了。前台aspx页面
    <asp:Repeater ID="ListBody" Runat="server">
    <ItemTemplate>
    <td width="10%">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td>xxxx</td></tr>
    </table>
    </td>
    </ItemTemplate>
    </asp:Repeater>后台cs页面
    private void ListBody_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    if (e.Item.ItemIndex % 10 ==1)
    this.ListBody.Controls.Add(new TableRow());
    }
      

  6.   

    放CHECKBOX和满10个就换行有关系吗?建立一个模版,把CheckBox放到里面,然后按10行分页就是了
      

  7.   

    是不是复选框?内容从数据库绑定?那用CheckBoxList控件,我一直用这个的。可以控制样式,包括每行多少个等等。
      

  8.   

    对啊楼上的,如何使用CHECKBOXLIST啊???
      

  9.   

    学会用MSDN
    CheckBoxList是最简单的选择
      

  10.   

    倒....我是兔子啊....04年8月我成4个角的时候就认识你了吧...当时你就是html版版主
      

  11.   

    现在你厉害啊,混成ASP版主了,我还以为你是小猪妹呢~~