473,497 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Binding stored procedure to a datagrid

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

Nov 22 '05 #1
3 2350
Stephen,

As far as I know does SQL scripting not support Datagrids.

Cor
Nov 22 '05 #2
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" <St*****@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
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

Nov 22 '05 #3
"Stephen" <St*****@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
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
Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
483
by: Stephen | last post by:
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...
0
1070
by: Stephen | last post by:
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...
0
1147
by: Sal | last post by:
I just had a C# conversion project thrown at me, and must bind several text boxes on a form to different columns from a table. We have to use stored procedures that are called through data layer...
0
2629
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
1
1253
by: .Net Sports | last post by:
i have an aliased column in an sql statement that works fine when displaying its output in a datagrid, but when I transfer the sql statement into a stored procedure , the datagrid can't see it. I...
6
2696
by: Jim | last post by:
Can someone, please, show me how to display the results of a stored procedure in a VB.NET datagrid on a winform? I'm a newbie. Here's my SQL 2000 stored precedure that returns the status of...
4
1611
by: jaYPee | last post by:
I have downloaded some source code but I want this to convert the results into datagrid. dr = cmd.ExecuteReader() '**************************************** ' SHOW THE RESULTS...
2
2467
by: Joe Befumo | last post by:
I'm using a datagrid, and have it get its data from a stored procedure. I've set up a table adaptor and related binding source pointing to my stored procedure, but can't figure out how to pass a...
6
5715
by: p.mc | last post by:
Hi all, I'm having major problems with a userControl which contains a datagrid. My problem concerns data binding. The Page_Load() procedure calls the DataBind procedure to bind the datagrid...
1
3772
by: Aeric | last post by:
I have read the following topic: sorting dataset and I am facing the same issue. I am designing a report. I have fill a dataset with the results from a query. From the results, I used to set...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.