Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Calling Procedure to populate drop down

$
0
0

hi,

I want to call a Procedure to populate drop down in a form.  Right now I  am using the code like this:

<td class="style4">Choose Category:&nbsp;<font color="red">*</font></td><td class="style3"><asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="cat1"
                                                            DataTextField="catname" DataValueField="catname"></asp:DropDownList><asp:SqlDataSource ID="cat1" runat="server"
                                                            ConnectionString="<%$ ConnectionStrings:billingdatabase%>"
                                                            ProviderName="System.Data.SqlClient"
                                                            SelectCommand="SELECT [catname] FROM [Category]"></asp:SqlDataSource></td>

The Procedure in DB:

go
create procedure [dbo].[spshowproducts]
as
begin
select catname from Category 
end
GO

Please tell me how to call this procedure in the aspx code to populate the dropdown.


Viewing all articles
Browse latest Browse all 5678

Trending Articles