|
 |
aspx thread: Accessing a field within a dataset.
Message #1 by "Oliver, Wells" <WOliver@l...> on Fri, 11 Oct 2002 09:42:45 -0700
|
|
So I have a datalist which has a datasource of objDS, which is a one-table
dataset.
I have an OnItemCreated event in which I want to assign as selected an
element in a dropdown list if a certain field in that dataset has a value of
1...
How can I look inside of a dataset's tables, rows, and values? Any tips?
Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com
Message #2 by "Carole D. Sullivan" <carolesullivan@e...> on Fri, 11 Oct 2002 20:31:42
|
|
1) You can loop thru a dataset:
Dim drGtnDetail As DataRow
''loop thru the dataset and replace the source codes with text
values from the hashtable
For Each drGtnDetail In DsGtnSearch1.Tables
("sqlPyhGtnSearch").Rows
If drGtnDetail("SOURCECD") <> " " Then
drGtnDetail("SOURCECD") = htSourceCodes(drGtnDetail
("SOURCECD"))
End If
drGtnDetail("GTNTYPE") = htGtnTypes(drGtnDetail("GTNTYPE"))
Next
2) Go directly to the a row and grab a field, the first row for example:
This returns the first row of the first table in your dataset, you could
also refer to the table within your dataset my name:
viewstate("strEmployeeName") = DsGtnSearch1.Tables(0).Rows(0).Item
("EMPLNAME")
> So I have a datalist which has a datasource of objDS, which is a one-
table
dataset.
I have an OnItemCreated event in which I want to assign as selected an
element in a dropdown list if a certain field in that dataset has a value
of
1...
How can I look inside of a dataset's tables, rows, and values? Any tips?
Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com
|
|
 |