0

我需要能够查看 SQL 数据库中的数据,并选择要打印的特定行(稍后处理)。考虑到我不需要在任何时候编辑数据,而我所需要的只是带有一个额外复选框的数据,那么最好的控制是什么?

4

1 回答 1

2

最有可能是GridView

<asp:SqlDataSource id="CustomersSource"
  SelectCommand="SELECT CustomerID, CompanyName, FirstName, LastName FROM SalesLT.Customer"
  ConnectionString="<%$ ConnectionStrings:AWLTConnectionString %>" 
  runat="server"/>

<asp:GridView id="CustomersGridView" 
  DataSourceID="CustomersSource" 
  AutoGenerateColumns="False"
  EmptyDataText="No data available." 
  AllowPaging="True" 
  runat="server" DataKeyNames="CustomerID">
    <Columns>
        <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" 
            InsertVisible="False" ReadOnly="True" SortExpression="CustomerID" />
        <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" 
            SortExpression="CompanyName" />
        <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
            SortExpression="FirstName" />
        <asp:BoundField DataField="LastName" HeaderText="LastName" 
            SortExpression="LastName" />
    </Columns>
</asp:GridView>
于 2013-01-31T14:45:20.417 回答