Convert DataRow to an array or list

foreach (DataRow row in drlist)
        {
                foreach (string str in row.ItemData)
                {
                    sb.Append(str)
                }
         }
List<DataRow> drlist = dt.Rows.AsEnumerable().ToList();
foreach (DataRow row in drlist)
        {
                if (!row.IsNull(0)) 
                {
                       foreach (string str in row.ItemArray)
                       {
                              sb.Append(str);
                       }
                }
                else 
                {
                        sb.Append("");
                }
         }
List<string[]> results = dt.Select().Select(dr => dr.ItemArray.Select(x => x.ToString()).ToArray()).ToList();

 

2020-04-20