我想调用一个过程来填充表单中的下拉列表。现在我正在使用这样的代码:
<td class="style4">Choose Category: <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>
步骤:
GO
CREATE PROCEDURE [dbo].[spshowproducts]
AS
BEGIN
SELECT catname FROM Category
END
GO