Skip to Content
0
Jan 17, 2012 at 06:49 AM

Does a DataSet store a copy of data or just a pointer?

27 Views

I apologise since this question is not strictly Crystal, but I nevertheless thought that someone here had the answer 😊

I am building a DataSet in memory for the purpose of reporting in

Crystal Reports and the question is simply:

while(!set.IsEOF())

{

//

Numvar = set.GetInt(0);

Stringvar = set.GetString(1);

r = t->NewRow();

r->default[0] = Numvar;

r->default[1] = gcnew String(Stringvar);

t->Rows->Add(r);

set.MoveNext();

}

(managed C++)

Is the contents of Stringvar copied to the dataset or just a pointer?

Ie is it safe to deallocate the string var after the Add()?

Or am I going about this the wrong way?