I have this part of code:
MeasDataSet dset = new MeasDataSet();
MeasDataPoint point = new MeasDataPoint();
//...
MeasDataSet dset2 = new MeasDataSet(dset._path);
dset2.SaveResults();
point = dset2.GetDataPointAt(dset2.Size - 1);
point.Current = 7566;
dset2.SaveResults();
Where MeasDataPoint and Set are just some classes containing measurement data (point a single point and set a collection of points with additional methods)
When calling SaveResults() it should save the data inside the DataSet to a file, but using the code above doesn't save the old point but instead the altered one (point.Current = 7566;). So basically point now changes my values inside my data set instead of being a copy what i expected it to be.
GetDataPointAt (method of DatasSet):
public MeasDataPoint GetDataPointAt(int numberOfPoint)
{
return _dataPoints.ElementAt(numberOfPoint);
}
Anyone an idea why it behaves this way?