TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gustavo
NA
1.3k
454.1k
How Do I: Get the column name from a datareader?
May 22 2010 2:03 PM
Hello:
I am trying to get the name of the column in the datareader in a for/loop. I can get the value of the column, but I also need the name. What do I have wrong or how can I get it?
for
(
int
i = 0; i < ClassDB.DBDataReader.FieldCount - 1; i++)
{
//TheColumnName = ClassDB.DBDataReader....????
TheColumnValue = ClassDB.DBDataReader[i].ToString();
MessageBox
.Show(
"i="
+ i +
" TheColumnName="
+ TheColumnName +
" TheColumnValue="
+ TheColumnValue);
}
Reply
Answers (
1
)
file Browse
Convert string to list_entry