Looks like you have copied piece of code from
here.[
^]and just tried it. What you are trying is different than what's being done in the sample of that link.
You don't need to make the datatable in order to fill the dropdown and display the appropriate sections in dropdownlist.
Use a template field, where in ItemTemplate fill/set Dropdown values.
One of the ways to do it can be:
<asp:TemplateField HeaderText="User Name">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="true" DataSourceID="SqlDataSource1" DataValueField=sectionname AutoPostBack="True" SelectedValue='<%# Bind("sectionname")%>'>
<asp:ListItem Value="">Select an Item</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
If still needed, just google, how to add dropdown to gridview, and you will find lots of writeup on that. :thumbsup: