Getting Data for a stored procedure

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
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top