|
-
May 12th, 2003, 08:41 AM
#1
Thread Starter
PowerPoster
DataRow...Not getting it!
I have a dataset filled with 1 and only 1 row in a table called Broadcasts.
How do I read the value from the Title column? This errors out saying that there is no row at 0 or the same message if I change it to 1.
Waz up?!
Code:
dsCRH.Tables("Broadcasts").Rows(0)("Title")
-
May 12th, 2003, 09:15 AM
#2
Sleep mode
try this :
VB Code:
MessageBox.Show(dsCRH.Tables("Broadcasts").Rows(0).Item(0))
-
May 12th, 2003, 09:15 AM
#3
Thread Starter
PowerPoster
Originally posted by Pirate
try this :
VB Code:
MessageBox.Show(dsCRH.Tables("Broadcasts").Rows(0).Item(0))
cool got it thanks
-
May 12th, 2003, 10:21 AM
#4
PowerPoster
Or you could do something like this:
Dim dr as DataRow
dr = dsCRH.Tables("Broadcasts").Rows(0)
MessageBox.Show(dr("ColumnName").ToString())
I am not one hundred percent sure on the syntax for VB.Net, but I think I got it right (To lazy to check it...lol).
Anyway, if you are only expecting one row back, why use the dataset object in the first place? You can just the DataRow object which holds only one row. Just a thought.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|