Caller:
if (DoSqlScalar("SELECT COUNT(*) FROM TABLE_NAME") > 0)
...process rows...
The "Caller" executes the above "if statement" once every second, and
processes any records (rows) with a seperate method that uses
cmd.ExecuteResultSet()... However, my following results occur without ANY
rows in the table! So what's the problem, you ask? The above method consumes
an incredible 10MB+ within 10-15 minutes!! And can ultimately consume up to
15MB...Why? During execution there are NEVER any records in the target
Table!!
The localConnection is opened once, at the begining of the program, and is
never closed until the program ends. The connection string is defined as:
string appDir =
Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
string fileName = appDir + "\\CommQueue.sdf";
localConnection = string.Format("Persist Security Info = False;
DataSource=\"{0}\"; Password='{1}'; File Mode = 'read write'; Max Buffer
Size = 2048", fileName, "OU812");
This program is the only app accessing the local database, and is using a
single thread to do so. Also, the catch statement never gets hit. Again...
There are NEVER any records (rows) in the SqlCE Database Table. I've seen
several posts regarding SQLCE/ExecuteScalar and memory leaks but they all
seem to think that the problem is due to incorrect disposal/closure of the
database connection (localConnection above). However, again, my code opens
the connection and uses it for the duration of program execution, and is
properly disposed of (closed, set to null, etc.) when the application exits.
Any ideas?
Thank you for your time,
- Greg