asp.net populating, working with datatable objects

working with groupby and datasets


private DataSet getEmptyDataSet(int numOfColumns)
    {
        DataTable dt = new DataTable();
        for(int i=0;i<numOfColumns;i++)
        {
            DataColumn dc = new DataColumn("col" + i);
            dt.Columns.Add(dc);
        }
        DataRow dr = dt.NewRow();
        for (int i = 0; i < numOfColumns; i++)
        {
            dr[i] = "col" + i;
        }
        dt.Rows.Add(dr);
        DataSet ds = new DataSet();
        ds.Tables.Add(dt);
        return ds;
    }

you can not new a datarow but has to ask the datatable to create it

You can not index into the collection but you have to use the explicit add function