dt.Columns.Add("CaseNumber"); dt.Columns.Add("Subject"); dt.Columns.Add("Description"); dt.Columns.Add("Owner"); dt.Columns.Add("CreatedDate"); for (int i = 0; i < qr.records.Length; i++) { Case newCase = (Case)qr.records[i]; DataRow dr = dt.NewRow(); dr["CaseNumber"] = newCase.CaseNumber; dr["Subject"] = newCase.Subject; dr["Description"] = newCase.Description; dr["Owner"] = newCase.Owner.Name1; dr["CreatedDate"] = newCase.CreatedDate; dt.Rows.Add(dr);