How Do I: Get the column name from a datareader?
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);
}