System.Data.Tests.DataSetTest2.dataSetDescription C# (CSharp) Method

dataSetDescription() private method

private dataSetDescription ( DataSet ds ) : string
ds DataSet
return string
        private string dataSetDescription(DataSet ds)
        {
            string desc = string.Empty;
            desc += "DataSet Name=" + ds.DataSetName;
            desc += " Tables count=" + ds.Tables.Count;
            foreach (DataTable dt in ds.Tables)
            {
                desc += " Table Name=" + dt.TableName;
                desc += " Rows count=" + dt.Rows.Count;

                string[] colNames = new string[dt.Columns.Count];
                for (int i = 0; i < dt.Columns.Count; i++)
                    colNames[i] = dt.Columns[i].ColumnName;

                Array.Sort(colNames);

                foreach (DataRow dr in dt.Rows)
                {
                    desc += " Items count=" + dr.ItemArray.Length;
                    foreach (string name in colNames)
                    {
                        desc += " " + dr[name].ToString();
                    }
                }
            }
            return desc;
        }
DataSetTest2