I have a dataset with one datatable, one row and six columns:
DataSet holdall = new DataSet();
holdone.Fill(holdall);
DataTable invoiceTable = holdall.Tables["INVOICE"];
The data comes from an SQL database, and consists of several different data types. I need to pass this data into an array or a list (AFAIK An array is more appropriate), and on the way convert it into string format:
string[] currentInvoice = new string[6];
currentInvoice = invoiceTable.AsEnumerable().Take(1).ToString().ToArray();
This gives me the following error:
Cannot implicitly convert type 'char[]' to 'string[]'
I have also tried
foreach (DataRow INVOICE in invoiceTable.AsEnumerable())
{
currentInvoice.ToArray();
}
However, this returns a Null exception, that leads be to believe that there is no data in the datatable. Upon examining the datatable via a stop point, I find that there is the correct amount of data.
Am I overcomplicating this?