Walaa,
thank you for the suggestion. Just did that and it works well.
In order to get the space used for each datatable, using the storedprocedure sp_spaceused, I did the following:
private DataTable SPSpaceUsedForEachTable()
{
// ForEach Table construction, using the EntityType enum.
EntityType et = EntityType.Mapl_AdEntity;
String[] tableNames = Enum.GetNames(et.GetType());
SqlParameter[] sqlParms = new SqlParameter[2];
String objName = String.Empty;
for (Int32 i = 0; i < tableNames.Length; i++)
{
objName = tableNames[i].TrimEnd("Entity");
sqlParms[0] = new SqlParameter("@objname", objName);
sqlParms[0].IsNullable = true;
sqlParms[1] = new SqlParameter("@updateusage", "true");
sqlParms[1].IsNullable = true;
DataTable tempTable = new DataTable();
DbUtils.CallRetrievalStoredProcedure("sp_spaceused", sqlParms, tempTable, null);
DataRow tempRow = tempTable.Rows[0];
DataRow newRow = spaceUsedDataTable.NewRow();
newRow.CopyValuesFrom(tempRow);
newRow[6] = String.Format("{0} {1} {2} {3}", tempRow[2], tempRow[3], tempRow[4], tempRow[5]);
spaceUsedDataTable.Rows.Add(newRow);
}
return spaceUsedDataTable;
}