C# と OBDC DSN を使用して Paradox データベースに接続しています。各接続を開いたり閉じたりすると、メモリがリークしているようです。
私のコードは基本的に次のとおりです。
csb.Dsn = "DNSName";
OdbcConnection con = new OdbcConnection(csb.ConnectionString);
con.Open();
OdbcCommand comm= new OdbcCommand("SELECT * FROM Tabl", con);
OdbcDataReader reader= null;
try
{
reader= comm.ExecuteReader();
for (int count = 0; (count < 5 && reader.Read()); ++count)
{
//Read
}
}
finally
{
if (reader!= null)
{
reader.Close();
reader.Dispose();
}
if (comm!= null)
{
con.Close();
con.Dispose();
OdbcConnection.ReleaseObjectPool();
GC.Collect();
comm.Dispose();
}
}
アイデアや提案はありますか?
更新 1
ステートメントを使用するように変更しましたが、まだリークしています。