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

DB Value in Label

A ASPX Form has a DataGrid & a Label. The Label resides outside the
DataGrid. The DataGrid displays records from a SQL Server database
table. The Label should display the value of a column named *CustName*
which will be common to all the records that the SQL query will
retrieve. This is the code:

========================================
Sub Button_Click(.....)
Dim dSet As DataSet
Dim strSQL As String
Dim sqlConn As SqlConnection
Dim sqlDapter As SqlDataAdapter

strSQL = "SELECT CustName,.........WHERE UserID = " &
Request.Form("UID")

sqlDapter = New SqlDataAdapter(strSQL, sqlConn)

dSet = New DataSet
sqlDapter.Fill(dSet, "MyTable")

MyDG.DataSource = dSet.Tables("MyTable").DefaultView
MyDG.DataBind()
End Sub
========================================

Now how do I display the *CustName* value in the Label control?

Apr 16 '07 #1
1 1160
<rn**@rediffmail.comwrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
Now how do I display the *CustName* value in the Label control?
MyLabel.Text = dSet.Tables[0].DefaultView[0]["CustName"].ToString()
Apr 17 '07 #2

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

Similar topics

2
by: Mountain Man | last post by:
Hi, I'm having trouble with the foreach function. I'm using it twice inside a user defined function with two different arrays, and in the second instance it's returning the value of the first...
1
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
4
by: stevewy | last post by:
If I am using srcElement (or "target" for non-IE models) to return various properties of an object I have clicked on, can I access for "label for" value in any way? I'm thinking, for example, of...
2
by: Thad | last post by:
In the html I have a select option. I am trying to get the result of the selection(u5503_qty*5) to print after some text. I am having a problem grabbing the value of u5503_qty from the html to use...
4
by: pradeep | last post by:
how to set input type label's value through javascript
1
by: imranabdulaziz | last post by:
Dear All, I am mess with one situation let me explain the scenario. I am making search form where I display 15 field in checkboxlist and user select one or two or three or any no to all field....
4
by: ballygowanboy | last post by:
i've put this code together. there's a variable "s" giving me some grief at the mo, i'm actualy supprised it half works. it's a simple shopping cart, you pick the quantitly of items, and it...
6
by: Ahmedhussain | last post by:
Hi there, I m doing work on a gridview and Im getting an error: A potentially dangerous Request.Form value was detected from the client (ctl00$Content$GridView1$ctl03$TextBox1="<span...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...
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
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
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
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.