Binding stored procedure to a datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following stored procedure below and I was wondering if I will be
able to bind the restuls to a datagrid for the first select statement and
display the results of the count in a label for the count. I wasn't sure if i
should have written two stored procedures to do this or if I'll be able to do
it the way it stands. I appreciate any help anyone is able to give me.

Was wondering if I needed to return a value as an output parameter to
achieve what I wanted??

CREATE PROCEDURE [sp_RegisteredUsers]
AS

SELECT u_user_title, u_first_name, u_last_name
FROM UserObject

Select Count (*)
From UserObject
GO
 
The dataset that is created should contain more than 1 table. Can't you bind
the label's text to be the value from the 2nd table?
 
Stephen said:
I have the following stored procedure below and I was wondering if I will
be
able to bind the restuls to a datagrid for the first select statement and
display the results of the count in a label for the count. I wasn't sure
if i
should have written two stored procedures to do this or if I'll be able to
do
it the way it stands. I appreciate any help anyone is able to give me.

Was wondering if I needed to return a value as an output parameter to
achieve what I wanted??

CREATE PROCEDURE [sp_RegisteredUsers]
AS

SELECT u_user_title, u_first_name, u_last_name
FROM UserObject

Select Count (*)
From UserObject
GO


Multiple result sets will appear as separate tables in the Dataset.

Be sure to include aliases for aggregate functions like Count so that they
may be referred to by name.

e.g. Select Count (*) as UserCount From UserObject
 
Back
Top