c# - How to populate specific DataTable column with values -
hello have datatable updatedvalues, , wondering if there way set value of column value.
int rowindex = 0; foreach(string val in something) { try { updatedvalues.columns["books"][rowindex] = val; console.writeline("went here"); } catch { } rowindex++; }
the try won't compile because has incorrect syntax, wondering if there similar in try.
your question confusing take stab @ response.
datatables matrices, similar excel, reference specific value access code:
var myval = datatable.rows[row][column]; //to value
or
var x = 1; var y = 3; datatable.rows[x][y] = myval; //to set value
and umphishrey's mcgee posted before me can iterate on values.
Comments
Post a Comment