473,395 Members | 1,941 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,395 software developers and data experts.

Rook Question

Very new. Need to bind a value from a stored procedure that returns a single
value to a label. I have found lots of examples of how to do this with a
datagrid using .filll and databind but no such methods for a label. Thanks
for the help
Nov 19 '05 #1
4 942
Dave S. wrote:
Very new. Need to bind a value from a stored procedure that returns a single
value to a label. I have found lots of examples of how to do this with a
datagrid using .filll and databind but no such methods for a label. Thanks
for the help


You could just assign the value (maybe with .ToString()) to the Text
property of the label.

--
Hans Kesting
Nov 19 '05 #2
Something like this (not tested):

<asp:Label" runat=server id=myLabel Text="<%# LabelText %>"></asp:Label>

where LabelText is the name of a property that will return stored procedure
result. If it's just a label, you don't really need to databind. Just run
the sp, get the value and assign it to the label's Text in the code.

Eliyahu

"Dave S." <da**********@colliergov.net> wrote in message
news:OH**************@TK2MSFTNGP10.phx.gbl...
Very new. Need to bind a value from a stored procedure that returns a single value to a label. I have found lots of examples of how to do this with a
datagrid using .filll and databind but no such methods for a label. Thanks
for the help

Nov 19 '05 #3
MyLabel.Text = MySQLCommand.ExecuteScalar()

Here's more info:
http://msdn.microsoft.com/library/de...calartopic.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Dave S." <da**********@colliergov.net> wrote in message
news:OH**************@TK2MSFTNGP10.phx.gbl...
Very new. Need to bind a value from a stored procedure that returns a
single
value to a label. I have found lots of examples of how to do this with a
datagrid using .filll and databind but no such methods for a label. Thanks
for the help

Nov 19 '05 #4
At first I didn't get this, but it does work perfectly, thanks!

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uS*************@TK2MSFTNGP12.phx.gbl...
MyLabel.Text = MySQLCommand.ExecuteScalar()

Here's more info:
http://msdn.microsoft.com/library/de...calartopic.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Dave S." <da**********@colliergov.net> wrote in message
news:OH**************@TK2MSFTNGP10.phx.gbl...
Very new. Need to bind a value from a stored procedure that returns a
single
value to a label. I have found lots of examples of how to do this with a
datagrid using .filll and databind but no such methods for a label. Thanks for the help


Nov 19 '05 #5

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

Similar topics

2
by: Don Moore | last post by:
simple c I think, department has a budget available for comp equip. and software of $6000. amounts are to be typed as input as received. need a program that will read amounts and report as soon...
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
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: 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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.