How do I display the columnnames of an sql table with C# -


i using fusionchart display data. i've created stringbuilder, inserts data. use stackedcolumn, multi-series chart. how set value written inside sql table.

            while (rst.read())         {             (int = 0; <= seriesquantity; i++)             {                 if (i == 0)                 {                     // category-stringbuilder                     stringbuilders[i].appendformat("<category label='{0}'/>", rst[0].tostring());                 }                 else                 {                     stringbuilders[i].appendformat("<set value='{0}'/>", rst[i].tostring());                 }             }         } 

but there seriesname, need set. code. seriesnames displayed 1-4, need them have value of of colunname. how can display names of colums?

 (int = 0; <= seriesquantity; i++)         {             if (i == 0)             {                 xmlstr.append("<categories>" + stringbuilders[i].tostring() + "</categories>");             }             else             {                 xmlstr.append("<dataset seriesname='" + + "'>" + stringbuilders[i].tostring() + "</dataset>");             }         }         xmlstr.append("</chart>"); 

you can use getname method.

gets name of specified column.


string colname = rst.getname(i);


Comments