2008
04.07
Apparently there is no way I haven’t find a way to determine the size of a .NET managed object in memory.

The closest I can come out, particularly for a DataSet object is as follows:
DataSet ds = new DataSet();
// ...
// This is where you populate the content of DataSet
// ...
String xmlContent = ds.GetXml();
UnicodeEncoding uniEnc = new UnicodeEncoding();
int byteCount = uniEnc.GetByteCount(xmlContent);
But why we use UnicodeEncoding, not ASCIIEncoding, or UTF8Encoding, well, as MSDN says, String object is a collection of Unicode characters. So if we want to know how many bytes are they, we need to use UnicodeEncoding.
Of course we are still far from our actual objective, but this is a good start. I’ll update as I found other possible method.
Share and Enjoy
Possibly Related Posts
how to check dataset size (3), how to find dataset size (2), how to find size of dataset (2), determine dataset size (2), c# measure object size (1), how to find the length of dataset in vb net (1), how to find the size of a dataset (1), how to find the size of a dataset vb net (1), how to find the size of net object (1), how to get size dataset in asp net in bytes (1), how to know the size of object in Net (1), net find size of object (1), size of the dataset in net (1), vb net get dataset size in bytes (1), how to find dataset data size (1), how to determine size of dataset (1), how to decide the size of a dataset in vb (1), calculating size of dataset in vb net (1), check the size of dataset in c# (1), determin object size in net (1), determine size of dataset (1), determine the size of dataset (1), determine the size of datset (1), determining size of dataset (1), get length of dataset for post vb net (1), get size of object vb net (1), how know size dataset (1), how to check the size of an object in vb net (1), vb net how to calculate size of object (1)
Hmm.. to think about it… Serialization could do the trick….