i have a drop down list in my Gridview. I want to poplulate it with the values from the database ... However i am confused how to proceed ......here is my code snippet:
In the source i have written the followin code :
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="AccessDataSource1" Width="515px">
<Columns>
<asp:TemplateField HeaderText="My DDL Column">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSource='<%# %>' [B]What to write here ???????????? [/B]
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" SortExpression="EmployeeID" />
<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
</Columns>
</asp:GridView>
in dropdownlist after datasource filed do we mention the database
column names ?? n how connection is establised with database here ?? pl help me out am confused!
Cya
Rohan