I am working on Data table in C#. I want to retrieve the data from data table row wise into an array. But i am getting exception. I want to read the data row wise.
I have tried,
System.Data.DataTable _dtDataFile = new System.Data.DataTable();
myCommand.Fill(_dtDataFile);
string[] arr1 = new string[3];
_dtDataFile.Rows.CopyTo(arr1,0);
Response.Write("DONE" + arr1[0]+ "<BR>" + "<BR>");
I am getting Invalid cast exception.
Can any one help how it can be done.
Thank you.