Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning results in a datagrid and label

Status
Not open for further replies.

lsmyth1717

Programmer
Mar 25, 2005
44
GB
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??

Or is there a better way of doing this altogether

CREATE PROCEDURE [sp_RegisteredUsers]
AS

SELECT u_user_title, u_first_name, u_last_name
FROM UserObject

Select Count (*)
From UserObject
GO
 
just bind the first sp to the datagrid...then the label would be

mylabel.Text = myDataGrid.Items.Count.ToString()

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top