DataTable dt1 = new DataTable(); DataRow row; int obj1; for ( int x= 0; x<dt.Rows.Count; x++) { int.TryParse(dt.Rows[x][0].ToString(), out obj1); row = dt1.NewRow(); row.ItemArray = obj1; dt1.Rows.Add(row); }
row.ItemArray = (object)obj1;
dt.Rows
int val = (int)dr["myIntField"];
int val = (int)dr[0]; // the first field
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)