I've used the insert command through the code front in aspx and the output parameter is:
asp:Parameter Name="ReturnCustomerID" Type="String" Direction="Output"
and in the codebehind (C#) for OnInserted="SqlDS_CustomerDetails_OnInserted" i have:
protected void SqlDS_CustomerDetails_OnInserted(object sender, SqlDataSourceStatusEventArgs e)
{
String newCustomerID;
newCustomerID = e.Command.Parameters["@ReturnCustomerID"].Value.ToString();
}
But for some reason I keep getting a null for my return value... I've tried executing the stored procedure direct in SQL server and it's fine and returns a proper ID but not in the c# or ASPX.
Is there a way to directly "eval" an output param to the text of a label in the code front? i.e.
asp:Label ID="NewCustomerID" runat="server" Text='<%# Eval("ReturnCustomerID") %>'>
I just need whichever method to bind the ID to that label.
newCustomerID = e.Command.Parameters["ReturnCustomerID"].Value.ToString();