<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
DataMember="DefaultView" BackColor="#C0C0FF" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowSelectButton="True"></asp:CommandField>
<asp:BoundField HeaderText="StudentID" DataField="StudentID" SortExpression="StudentID">
</asp:BoundField>
<asp:BoundField HeaderText="StudentName" DataField="StudentName" SortExpression="StudentName">
</asp:BoundField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1"
runat="server" ConnectionString="<%$ ConnectionStrings:ExForSysConnectionString2
%>"
SelectCommand="SELECT
DISTINCT [StudentID], [StudentName] FROM [StudentMaster]">
</asp:SqlDataSource>