C# App Freezing in DataGrid

G

Guest

This app is being developed on VS2005 Beta 1 (moving to Beta 2) in C#, .NET
CF, SQL Mobile 2005 on Windows Mobile 2003 SE Phone Edition. The hardware is
an Audiovox PPC-6600, 400MHz CPU, 128MB RAM (Sprint PCS).

I am using a datagrid to display information from the DB. When you click
the DG or chang cells, the app retrieves details from the DB based on the
current selection in the DG. The the screen is first loaded, I can click all
over the DG, and it will process the requests in order (although it can take
some time if I click a lot).

When I leave this screen to add information to the record, it disposes of
the screen with the DG. If I then return to the screen (other screens will
call this one to open again), and click around the DG again, it will
eventually freeze with the WindMill of Death.

Each click on the DG does create a new DataSet, and I am not currently
disposing of the datasets. I have catches for both SqlCeExceptions and
StackOverflowExceptions, neither of which are coming up (or at least the app
doesn't display the message boxes for them).

I do close the SqlCeConnection in the finally statement for the try if it is
open. What is curious is that I cannot get the DG to freeze the app when it
first loads, it is only after I dispose of the screen and then return to is
from another screen that I am able to get this to happen (and I can do it
consistently it seems).

Since no SqlCeExceptions seem to be coming up, I don't think it is a DB
access problem (although at this point I am open to any suggestions). I
don't know of any way to see what is happening with the memory to see if
garbage collection is failing to clean up memory fast enough to accomodate
the application.

Does anyone have any ideas as to what is causing this behaviour and how I
can eliminate it? At the very beginning of this project I did not have
this.Dispose() on any of the forms when I was just building them, but the
forms do need to be disposed to have the target end user correctly navigate
the application (the form that spawns the next form is not always the one I
want to return to because it could in that case allow them to edit data on
records that have been completed and should no longer be edited).

Any ideas/pointers/suggestions would be greatly appreciated! Thanks!
 
G

Ginny Caughey [MVP]

This certainly sounds like a memory related issue, especailly since you are
instantiating multiple datasets and not disposing them. What happens when
you either reuse a single global dataset or dispose the ones you are
creating?

Ginny Caughey
..NET Compact Framework MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top