i have a datable. i'm trying to populate it from file. i have the data for a single column, from the file, stored as a double[]. i have added a column like this...
DataColumn col = new DataColumn();
col.DataType = System.Type.GetType(type);
col.ColumnName = name;
col.AutoIncrement = false;
col.Caption = name;
col.ReadOnly = false;
col.Unique = true;
dt.Columns.Add(col)
...where 'name' is a string and dt is my datatable. the dataType is set to double. i now want to add the contents of my array but don't know how. this is as far as i am...
double[] da = getDoubleArray(data);
for(int i=0; i<da.Length; i++)
{
//this is where i would like to add a cell to my column with the correct data in it
}
}
what is the peice of code i am missing?
DataColumn col = new DataColumn();
col.DataType = System.Type.GetType(type);
col.ColumnName = name;
col.AutoIncrement = false;
col.Caption = name;
col.ReadOnly = false;
col.Unique = true;
dt.Columns.Add(col)
...where 'name' is a string and dt is my datatable. the dataType is set to double. i now want to add the contents of my array but don't know how. this is as far as i am...
double[] da = getDoubleArray(data);
for(int i=0; i<da.Length; i++)
{
//this is where i would like to add a cell to my column with the correct data in it
}
}
what is the peice of code i am missing?