Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
Questiondouble buffering Pin
bwagz1-Dec-05 1:32
bwagz1-Dec-05 1:32 
AnswerRe: double buffering Pin
mcljava2-Dec-05 8:26
mcljava2-Dec-05 8:26 
Questionwindow handle in .net Pin
ramenk1-Dec-05 1:18
ramenk1-Dec-05 1:18 
AnswerRe: window handle in .net Pin
S. Senthil Kumar1-Dec-05 3:13
S. Senthil Kumar1-Dec-05 3:13 
AnswerRe: window handle in .net Pin
Dave Kreskowiak1-Dec-05 6:30
mveDave Kreskowiak1-Dec-05 6:30 
Question.NET Deployment(embed msi in msi) Pin
sameerbhise.pspl1-Dec-05 1:03
sameerbhise.pspl1-Dec-05 1:03 
AnswerRe: .NET Deployment(embed msi in msi) Pin
Curtis Schlak.1-Dec-05 15:43
Curtis Schlak.1-Dec-05 15:43 
QuestionGetting the size of an object Pin
MrEyes1-Dec-05 0:42
MrEyes1-Dec-05 0:42 
hello all,

Quite simply, I need to get the size of an objects memory footprint, does anybody know how this can be done in C#? e.g The amount of bytes of memory a DataSet object uses after it has been populated via a database call.

I have looked at the sizeof(..) MSDN docs, but these indicate that the function is only valid for Value types and is also unsafe code (something I would prefer to avoid). There is also the System.Runtime.InteropServices.Marshal.SizeOf(..) function which unfortunatly returns the following error for datasets:

Additional information: Type System.Data.DataSet can not be marshaled as an unmanaged structure; no meaningful size or offset can be computed.

At the moment I have a very clunky piece of code that parses the DataSet via an XML object into a Byte[] and then uses the length of the array. Not very pretty at all

Thanks







post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
AnswerRe: Getting the size of an object Pin
Dave Kreskowiak1-Dec-05 6:29
mveDave Kreskowiak1-Dec-05 6:29 
AnswerRe: Getting the size of an object Pin
Andy Brummer1-Dec-05 8:08
sitebuilderAndy Brummer1-Dec-05 8:08 
GeneralRe: Getting the size of an object Pin
MrEyes1-Dec-05 23:01
MrEyes1-Dec-05 23:01 
Questionchange background of console Pin
lucluv1-Dec-05 0:40
lucluv1-Dec-05 0:40 
AnswerRe: change background of console Pin
Rob Philpott1-Dec-05 1:09
Rob Philpott1-Dec-05 1:09 
AnswerRe: change background of console Pin
Rob Philpott1-Dec-05 1:14
Rob Philpott1-Dec-05 1:14 
Questionproblem with XMLConvert.ToDateTime Pin
Rafferty Uy30-Nov-05 21:45
Rafferty Uy30-Nov-05 21:45 
AnswerRe: problem with XMLConvert.ToDateTime Pin
Rob Philpott30-Nov-05 23:28
Rob Philpott30-Nov-05 23:28 
GeneralRe: problem with XMLConvert.ToDateTime Pin
Rafferty Uy1-Dec-05 13:35
Rafferty Uy1-Dec-05 13:35 
GeneralRe: problem with XMLConvert.ToDateTime Pin
Rob Philpott1-Dec-05 21:10
Rob Philpott1-Dec-05 21:10 
QuestionWindows Service problem Pin
deep730-Nov-05 19:18
deep730-Nov-05 19:18 
AnswerRe: Windows Service problem Pin
leppie30-Nov-05 19:29
leppie30-Nov-05 19:29 
QuestionRead Another Programs Memory Pin
emiisdev30-Nov-05 17:07
emiisdev30-Nov-05 17:07 
AnswerRe: Read Another Programs Memory Pin
Rob Philpott30-Nov-05 23:09
Rob Philpott30-Nov-05 23:09 
GeneralRe: Read Another Programs Memory Pin
emiisdev1-Dec-05 5:20
emiisdev1-Dec-05 5:20 
GeneralRe: Read Another Programs Memory Pin
Rob Philpott1-Dec-05 6:07
Rob Philpott1-Dec-05 6:07 
AnswerRe: Read Another Programs Memory Pin
Dave Kreskowiak1-Dec-05 6:23
mveDave Kreskowiak1-Dec-05 6:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.