Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hhhhow to Reference a DataSet Field
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00720845
Message ID:
00722463
Views:
10
Hi Cathi,

Thanks.

Another question or two.

sAddress = ds1.Tables("Customer").Rows(0)("Name").ToString()

How would you refer to the current row, say after a lookup. Would not know what row would be the current row. (Current Position)

Also what if the data type is not a string type. I tried a boolean variable and the same syntax would not work.

bTrueFalse = ds1.Tables("HavingFun").Rows(0)("Name").toboolean

Also where is the best place to locate this type of information; Books or online? What are good books. Everyone seems to have one but they seem to be the same as Microsoft but presented differently.

I learn best where it layed out a-z not refer to this, refer to that, etc. Like the way the online documentation is presented. I get lost, and most of the time I cannot find the the answer I was looking for.

LIKE
==================
Command Syntax

Explain Syntax detail

Lots of examples.
==================

Control Properties especially are a problem for me, they are not explained in detail below the properties window and in some cases it states only the the name of the property is. No help to me.

Thanks
Roland

===========================================================================

>Hi Roland,
>
>The Rows(0) is the Rows collection class of the DataTable. The zero is the first row of the collection. All collections in .NET are zero based so to retrieve the 5th row, you would use Rows(4). A DataRow object is returned and from there you can retrieve each of the fields in the DataRow.
>
>>Bonnie,
>>
>>I thought I had tried that, but I have wasted your time by not reading or transferring the code correctly. Forgive me.
>>
>>What does the Rows(0) indicate?
>>
>>That work great!!!!!!!!
>>
>>Thanks
>>Roland
>>
>>============================================================================
>>
>>>Roland,
>>>
>>>Forgive me for being so dense, but I'm still trying to figure out exactly what it is you're trying to do. Maybe you're asking two different questions in one thread?
>>>
>>>Are you trying to set a variable equal to a column value from your DataSet? If so, you should do what I first posted, which was:
>>>
>>>sAddress = ds1.Tables("Customer").Rows(0)("Name").ToString()
>>>
>>>-- or the Typed DataSet equivalent
>>>
>>>sAddress = ds1.Customer(0).Name
>>>
>>>
>>>But, maybe you're trying to set a textbox equal to a column value from your DataSet (the second thing you mentioned), in which case I have to ask why you're aren't using data binding?
>>>
>>>~~Bonnie
>>>
>>>
>>>>Bonnie,
>>>>
>>>>Your right!!!
>>>>
>>>>It gives me the field name not the value.
>>>>
>>>>No syntax errors but just one step backwards!
>>>>
>>>>Any suggestions?
>>>>
>>>>Thanks
>>>>Roland
>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform