Click here to Skip to main content
15,743,541 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have to get the Values ( A,B,C,D) from a table Named as dbo.Names from SQL Server.I had done it manually ,but how to i achieve the same using select statement from table..???or a variable having the value from stored procedure??

                <div class="col-sm-4 lhs-form-box" style="padding: 10px; height: 247px;">
                    <div class="form-group" style="width: 87%; float: left;">
                        <label for="sel1">ITEM</label>
                        <asp:DropDownList ID="ddl_QU" runat="server" class="form-control">
                            <asp:ListItem Text="A" Value="A"></asp:ListItem>
                            <asp:ListItem Text="B" Value="B"></asp:ListItem>
                            <asp:ListItem Text="C" Value="C></asp:ListItem>
                            <asp:ListItem Text="D" Value="D"></asp:ListItem>
                        <img src="info.png" style="margin: 31px 0px 0px 5px"></span>


What I have tried:

I have done it manually.
How do i achieve same using select statement from DB.
Updated 18-Apr-17 4:17am

Share this answer
Please refer below link you will get idea how you need to populate it from database progrmatically.

c# - What is the right way to populate a DropDownList from a database? - Stack Overflow[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900