maqskywalker
asked on
asp.net web forms C# , display stored procedure result on label
Hi experts,
I saw this example:
How to return Output parameter from Stored Procedure in ASP.Net using C# and VB.Net
https://www.aspsnippets.com/Articles/How-to-return-Output-parameter-from-Stored-Procedure-in-ASPNet-in-C-and-VBNet.aspx
In that example which he gives the sql server and asp.net code.
He has a stored procedures that looks like this:
How would I revise that exact same example.
If my stored procedure looked like this.
I just want to display the name of the fruit on the label of the asp.net page for whatever fruitid i submitted in the textbox.
I saw this example:
How to return Output parameter from Stored Procedure in ASP.Net using C# and VB.Net
https://www.aspsnippets.com/Articles/How-to-return-Output-parameter-from-Stored-Procedure-in-ASPNet-in-C-and-VBNet.aspx
In that example which he gives the sql server and asp.net code.
He has a stored procedures that looks like this:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetFruitName]
@FruitId INT,
@FruitName VARCHAR(30) OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SELECT @FruitName = FruitName
FROM Fruits
WHERE FruitId = @FruitId
END
How would I revise that exact same example.
If my stored procedure looked like this.
I just want to display the name of the fruit on the label of the asp.net page for whatever fruitid i submitted in the textbox.
USE [FruitsDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetFruitNameTest1]
@FruitId INT
AS
BEGIN
SET NOCOUNT ON;
SELECT [FruitId]
,[FruitName]
FROM [FruitsDB].[dbo].[Fruits]
WHERE FruitId = @FruitId
END
GO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER