Getting Data for a stored procedure

  • Thread starter Thread starter jed
  • Start date Start date
J

jed

I have created a stored procedure in SQLExpress management.I need to
retrieve a numeric value that the stored procedure creates and use it
in a C# application.Please help thanks.
USE [biking checks]
GO
/****** Object: StoredProcedure [dbo].[Getlastodo] Script Date:
03/19/2007 00:54:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Getlastodo]

AS
BEGIN

SELECT MAX(Totaldistance) AS lastodo
FROM bik

END
need to retrieve the lastodo value
 
I have created a stored procedure in SQLExpress management.I need to
retrieve a numeric value that the stored procedure creates and use it
in a C# application.Please help thanks.
USE [biking checks]
GO
/****** Object: StoredProcedure [dbo].[Getlastodo] Script Date:
03/19/2007 00:54:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Getlastodo]

AS
BEGIN

SELECT MAX(Totaldistance) AS lastodo
FROM bik

END
need to retrieve the lastodo value

You execute the stored procedure and you get a DataReader which
you read just as if it were a SELECT you had executed.

Arne
 
Back
Top