[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

access dataview elements by name

I currently have a Dataview that returns a single row (after applying a rowfilter). I can access the fields with Dataview1(0)(n) and this works fine.

I'd much rather access the fields by column name to make changing the code in future easier, but I can't figure out how.

Any suggestions welcome!

Ben
0
PapaSmurf
Asked:
PapaSmurf
1 Solution
 
DabasCommented:
Hi Ben:
Try the following:

        Dim dr As DataRowView = DataView1.Item(0)
        TextBox1.Text = dr.Item("FieldName").ToString

Dabas
0
 
PapaSmurfAuthor Commented:
Thanks Dabas, spot on.

I was soooo close......
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now