日期:2014-05-17 浏览次数:20485 次
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"> <HeaderTemplate> <table> <% DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty); foreach (DataRow row in dv.Table.Rows) { foreach (DataColumn col in dv.Table.Columns) { %> <tr><td><%=row[col] %></td></tr> <%} }%> </HeaderTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [EmployeeID], [LastName], [FirstName] FROM [Employees]"> </asp:SqlDataSource>
------解决方案--------------------
楼上的方法不错 有点类似 asp... mvc
------解决方案--------------------