locked
DataColumnCollection to DataColumn Array RRS feed

  • Question

  • How do convert DataColumnCollection to Data Column Array??


    Happy Coding, RDRaja
    Saturday, January 2, 2010 7:20 AM

Answers

  • I am sorry, that is protected property. use following instead:
    DataColumn[] dca = new DataColumn[youDataColumnCollection.Count];
    youDataColumnCollection.CopyTo(dca, 0);

    With best regards, Yasser Zamani
    Saturday, January 2, 2010 7:39 AM

All replies

  • DataColumn[] dca = (DataColumn[])yourDataColumnCollection.List.ToArray();

    With best regards, Yasser Zamani
    Saturday, January 2, 2010 7:24 AM
  • Hi Yasser.
     DataColumnCollection has no List Class



    Happy Coding, RDRaja
    Saturday, January 2, 2010 7:29 AM
  • I am sorry, that is protected property. use following instead:
    DataColumn[] dca = new DataColumn[youDataColumnCollection.Count];
    youDataColumnCollection.CopyTo(dca, 0);

    With best regards, Yasser Zamani
    Saturday, January 2, 2010 7:39 AM