ok i seem to be having a very basic data access problem. I have a control that is bound to a table, say the typical authors table. The table has AuthorName, authorID, and city.
The user selects (using lbAuthor) the author by authorID and I want to use the corresponding city to do something else. I know this is simple, but I tried to create a datarow and set it to the current selection and then couldnt figure out how to access the element from the datarow...
Hello Cragi,
If your data is stored in a simple datarow you could simply access it by the indexing property of the datarow...
ie label1.text = dr("City").tostring()
But I suppose your situation is a little bit more complicated than that.
Could you please post some code??
Thanks
Dim drChannel() As DataRow = Me.MyRSSData1.Channels.Select("channelid = " & CStr(Me.lbChannel.SelectedValue))
RssUrl = drChannel("URL").ToString
I was trying to select a databound control and then find its corresponding URL to pull an rss feed, by looking up the corresponding row in the first line and writing it to the URLstring in the second. This gives me an error during runtime
I think I got it now..kind of... Since its a select statement I'm running, it will return an array of datarows, and I need to add index '0'...though I'm sure there was an easier way to do this..
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment