B
Beri Tamas
Hello,
I have a significant problem with the DataSet (SqlCeDataAdapter) object.
The following piece of code:
Cursor.Current=Cursors.WaitCursor;
SqlCeConnection _con=null;
SqlCeDataAdapter _da=null;
DataSet _ds=null;
try{
_con=new SqlCeConnection("<my data source>");
_con.Open();
_da=new SqlCeDataAdapter("SELECT * FROM Something",_con);
_ds=new DataSet();
_da.Fill(_ds,"dummy");
}
catch{}
finally{
if(_ds!=null){
_ds.Clear();
}
if(_da!=null){
if(_da.SelectCommand!=null)_da.SelectCommand.Dispose();
_da.Dispose();
}
if(_con!=null){
_con.Close();
_con.Dispose();
}
}
System.GC.WaitForPendingFinalizers();
System.GC.Collect();
Cursor.Current=Cursors.Default;
causing an error, a memory leak, the amount of the lost memory depends on
the data in the result set of the select command. The memory will not be
reclaimed, only when I close the whole program itself.
Anyone has an idea?
Thanks,
Tamas Beri
I have a significant problem with the DataSet (SqlCeDataAdapter) object.
The following piece of code:
Cursor.Current=Cursors.WaitCursor;
SqlCeConnection _con=null;
SqlCeDataAdapter _da=null;
DataSet _ds=null;
try{
_con=new SqlCeConnection("<my data source>");
_con.Open();
_da=new SqlCeDataAdapter("SELECT * FROM Something",_con);
_ds=new DataSet();
_da.Fill(_ds,"dummy");
}
catch{}
finally{
if(_ds!=null){
_ds.Clear();
}
if(_da!=null){
if(_da.SelectCommand!=null)_da.SelectCommand.Dispose();
_da.Dispose();
}
if(_con!=null){
_con.Close();
_con.Dispose();
}
}
System.GC.WaitForPendingFinalizers();
System.GC.Collect();
Cursor.Current=Cursors.Default;
causing an error, a memory leak, the amount of the lost memory depends on
the data in the result set of the select command. The memory will not be
reclaimed, only when I close the whole program itself.
Anyone has an idea?
Thanks,
Tamas Beri