A Repasky

A Repasky

  • NA
  • 231
  • 180k

Find Field Count and Field names in Variable Type

Aug 24 2011 3:51 PM
How can I find the FieldCount and Field names?  Code is below.


Thanks,
arep



             using (StreamWriter sw = new StreamWriter("Output.txt"))
             {
                foreach (var v in DedOopLib.DebOop.nested)
                {
                   foreach (var i in v.Value.Values)
                   {
                      for (int fcnt = 0; fcnt < i.ToString().FieldCount; fcnt++)
                      {
                         sw.Write("\"");
                         sw.Write(i.GetName(fcnt));
                         sw.Write("\"");
                         if (fcnt != sw.FieldCount - 1) sw.Write(",");
                      }

Answers (2)