what does your data look like? if it is a master/detail type, look into nested repeaters (you can do similarly with nested datalists):How To Display Hierarchical Data by Using Nested Repeater Controls and Visual C# .NET
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q306154

解决方案 »

  1.   

    thanks, i think that's exactly what i want, my problem is a bit more complex though.请问,我可否控制  datalist  这样的控件所列数据的行数,因为它会把数据源中的所有行全部列出,  如果我想只列数据表中的前5行怎么办呢?  不能直接用 select top 5, 因为这个表和其它表是有关系的, 这些行是有符合条件的行。  多谢
      

  2.   

    use a dataview, DataView dv = YourChildDataTable.DefaultView;
    dv.Sort = "SomeColumn DESC";
    dv.RowFilter = " SomeColumn > '" + dv[5]["SomeColumn"].ToString() + "'";
      

  3.   

    really appreciate you help, very useful tips. i have found its a great leap from former server-side programming to the asp.net programming, a long long way to run!i happened to visit the joycode, and happy to be there to learn a lot, but 
    i wondered how the MVPs are elected, i used to receive the MCSE-MCDBA training,
    but uunfortunately, i have no time to get all exams passed (and now no money), 
    i just received a MCP certificate, any recommends that what should i do next.
    is a MVP must first be a MCSE or MCSD ?