473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 2349
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
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
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
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
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
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
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
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
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.