I have the following code:
string result = null;
string query = "SELECT * FROM Energy";
int index = 0;
sql.ConnOpen();
cmd = sql.Command(query);
try
{
reader = cmd.ExecuteReader();
while (reader.Read())
{
result += "Date: " + reader["Date"].ToString() + "Here goes columnName " + (reader[index++].ToString().Equals("0") ? "No" : "Yes") + "\n";
}
}
Where it says: Here goes columnName
(in the while loop), I want to add the name of the current column.
How can I obtain this? So notice that I want the name of the current column, NOT the value at the current column