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

Dynamically Populate A Label

I am trying to populate a label on a web form

Let’s say I have the following select statement

“Select Wonum, Location, Priority, Equipment from Workorderâ€

I have the following labels on the WebForm

wonumLabel, locationLabel, priorityLabel, equipmentLabe

How do I populate the labels

wonumLabel.Text =

locationLabel.Text =

priorityLabel.Text =

equipmentLabel.Text =
Nov 15 '05 #1
2 2360
You need to explain further. What format is your data source in when it
reaches the web page?

If it is a DataView...

wonumLabel.Text = theDataView[nRow].Row["theFieldName"]
"Dave Bailey" <an*******@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
I am trying to populate a label on a web form.

Let's say I have the following select statement:

"Select Wonum, Location, Priority, Equipment from Workorder"

I have the following labels on the WebForm:

wonumLabel, locationLabel, priorityLabel, equipmentLabel

How do I populate the labels?

wonumLabel.Text = ?

locationLabel.Text = ?

priorityLabel.Text = ?

equipmentLabel.Text = ?

Nov 15 '05 #2
As I said before ...
DataView objDV = CreateDataSource()
wonumLabel.Text = objDV[0].Row["Wonum"] // "0" is the first row in the
dataview

"Dave Bailey" <an*******@discussions.microsoft.com> wrote in message
news:D5**********************************@microsof t.com...
The DataView is created like this:

public DataView CreateDataSource()
{
string woConnect = "Connection String";
string woSelect = "Select Wonum, Location, Priority, Equipment where Wonum = 123456"; oda = new oleDbDataAdapter(woSelect, woConnect);
DataSet ds = new DataSet();
oda.Fill(ds, "wo");
DataView wo = ds.Tables{"wo"].DefaultView;
return wo;
}

How do I move from here to populating the labels?

Thanks,

Dave

Nov 15 '05 #3

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

Similar topics

10
by: David | last post by:
Can anyone give me a quick code snippet (that is standards-based) for adding OPTION tags to a SELECT dynamically. I have no problem doing it in IE but I am kind of new to the whole standards world...
3
by: Dmitry Korolyov [MVP] | last post by:
Is that possible? In other words, I want a dropdown list (and other list-type controls) which appears in edit more of a templated column to be populated with data at the run time. An attempt to do so...
5
by: Arpan | last post by:
In order to populate any server control with data dynamically, is it ALWAYS NECESSARY to either BIND the DataSource to that server control or call the DataBind method of that server control? For...
1
bergy
by: bergy | last post by:
I have a user control class, when a user selects the control (or it's children) the background of the control turns blue. When the user exits, it returns to its "unselected" state. I have...
1
by: stimul8d | last post by:
okay; ASP. I have i listbox inside a user control which is dynamically created on page_init. I check for postback and only populate the datasource if it's false. regardless, i do this ...
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:
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.