Q: datatable to array

  • Thread starter Thread starter dllhell
  • Start date Start date
D

dllhell

Hi all,
Is there a way to make a string array from DataTable?
I wish to avoid for statement...

thanks in advance
 
Object[] myObjArray = new object[DataTable1.Rows.Count];
DataTable1.Rows.CopyTo(myObjArray, 0);

dllhell said:
Hi all,
Is there a way to make a string array from DataTable?
I wish to avoid for statement...

thanks in advance

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Michael Nemtsev said:
Object[] myObjArray = new object[DataTable1.Rows.Count];
DataTable1.Rows.CopyTo(myObjArray, 0);

thanks for help, its better than what I have till now :)
but how I can get array for usage in form below

x=Arr[2,3]

and one more question:
if I use "arr[x,y] " should I have a better performance then with
"?Arr[1].ItemArray[1].ToString();" form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top