Trying to contact the database, I got a little confused about how to pass the value as a parameter (for example, itemID) and return records that have this identifier.
Here is my stored procedure:
ALTER PROCEDURE [dbo].[sp_lightItem]
(
@itemID INT
)
AS
BEGIN
SELECT [itemID],
[itemName],
[itemLocation],
[itemChBy]
FROM [dbo].[Item]
WHERE itemSystemType='E' and itemID=@itemID ORDER BY itemID DESC;
END
And this is my C # code.
public string LoadItemNew(int ItemID)
{
var acf = new AcFunctions();
var newstorevalue = SqlHelper.ExecuteDataset(acf.AcConn(), "sp_lightItem", ItemID);
}
As you can see in the stored procedure, I want to return these 4 elements:
[itemID],[itemName],[itemLocation],[itemChBy]
Unfortunately, I don't know how to return them / how to call them in a C # function.
Any help is appreciated.
source
share