The stored procedure parameters

<asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:WorkConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" SelectCommand="usp_GetProductOfPD"
runat="server">


The stored procedure with parameters, directly on the interface binding
How can I directly at the interface parameters of Le

Started by Yvonne at November 12, 2016 - 4:29 AM

You want to see what the parameters
<asp:ControlParameter
<asp:QueryStringParameter
.....

Posted by Broderick at November 27, 2016 - 4:33 AM

Can you write the specific point

Posted by Yvonne at December 12, 2016 - 5:00 AM

Is bound to meet up with the parameters of the stored procedure

Posted by Yvonne at December 15, 2016 - 5:16 AM

For example:
<asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:WorkConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" SelectCommand="usp_GetProductOfPD"
runat="server">

<SelectParameters>
<asp:SessionParameter Name="Projectid" SessionField="Projectid" Type="string">
</asp:SessionParameter>
<asp:SessionParameter Name="productid" SessionField="productid" Type="string">
</asp:SessionParameter>
</SelectParameters>
</asp:SqlDataSource>

The red part of my band two parameters but I how to bandage a stored procedure

Posted by Yvonne at December 24, 2016 - 5:22 AM

Projectid & The parameter productid is stored with the process.

Posted by Broderick at January 03, 2017 - 5:26 AM

Two are necessary conditions
But I have bound the two data does not show

Posted by Yvonne at January 07, 2017 - 7:48 AM

Session["Projectid "] & Session["productid"] Have you?

Posted by Broderick at January 12, 2017 - 6:15 AM

To give you an example

CREATE PROCEDURE [dbo].[GetProductsByCategoryID]
@ProductSubcategoryID int
AS
SELECT ProductID, Name, ProductNumber FROM Production.Product
WHERE ProductSubcategoryID=@ProductSubcategoryID ORDER BY ProductID


Categories:
<asp:DropDownList ID="lstCategories" DataSourceID="categoriesSource" runat="server"
DataValueField="ProductSubcategoryID" DataTextField="Name" AutoPostBack="true"></asp:DropDownList>

<asp:SqlDataSource ID="productsSource" runat="server" ProviderName="System.Data.SqlClient"
ConnectionString="<%$ ConnectionStrings:AdventureWorks %>"
SelectCommand="GetProductsByCategoryID" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="lstCategories" Name="ProductSubcategoryID" PropertyName="SelectedValue"/>
</SelectParameters>
</asp:SqlDataSource>

Posted by Broderick at January 13, 2017 - 7:14 AM