Solved

Reader.GetValues... field name?

Posted on 2007-11-19
1
569 Views
Last Modified: 2008-02-01
I am using a reader to get the field values from a table...
        Dim memberID As String = reader.GetValue(0)
        Dim username As String = reader.GetString(1)
        Dim email As String = reader.GetString(2)

How do I use the reader.Get... to get it by the field name?

Like I'm used to using:

Dim memberID As String = rs("username")

How do I do that?

thanks!

0
Comment
Question by:Starr Duskk
1 Comment
 
LVL 16

Accepted Solution

by:
McExp earned 500 total points
ID: 20316545
This should work for you: -

Dim username As String = reader.GetString(reader.GetOrdinal("Username"))

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to picture file 3 67
Word Directory is not in the drop down list 4 24
Runtime Error 2 28
ASP.NET 5 Templates 2 65
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now