Answers for "c# sqldatareader get column names"

SQL
0

Get the Db column names from a SqlDataReader

var reader = cmd.ExecuteReader();

var columns = new List<string>();

for(int i=0;i<reader.FieldCount;i++)
{
   columns.Add(reader.GetName(i));
}
Posted by: Guest on August-24-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language