Deadlock - Not Responding

  • Thread starter Thread starter Paul Say
  • Start date Start date
P

Paul Say

I have a one form application to import selected data from an Access
Database to a SQL Database.
The idea is to be able to eventually schedule the application to run in the
evenings.

The process of the application is as follows.

1) Loads a list of companies from the destination database(SQL) into a
CompanyCollection
2) Loops through each company in the collection and imports records by -
a) Loading a list of Jobs for the corresponding Company into a
DataTable then loops through each record in the
datatable
i) For each Job(Record in the datatable) , data for 6
Child tables are imported using datareaders to
read the from the source database - looping through the data reader
each record is inserted into the SQL database therough the execution of
stored procedures.

The form has a multi line textbox which sequentially records the Job No &
Description of each Job Loaded

i.e
Importing data for Company A
00-001 - Test Job 1
00-002 - Test Job 2........
Importing data for Company B
CD-345 - Test Job 1
CD-456- Test Job 2........

The Problem is as follows the application will take on adverage 13sec to
import a Job and its child records, however after the program has run for a
while aprox 20 Jobs(4 min), The application slows right down and appears to
halt, a Job can tak then anywhere from 1.5 min and up to import. I have
noticed at this point if I view the application in the windows task manager
it has a status of not responding, although it is still importing but rather
slowly.

I am wanting to know what I need to do to improve performance.

Paul Say
 
Paul Say said:
I have a one form application to import selected data from an Access
Database to a SQL Database.
The idea is to be able to eventually schedule the application to run in the
evenings.

<snip>

What are you doing in terms of threading?
 
Paul Say said:
I am not threading, Should I be and How would I approach it.

I would say you should definitely be using a worker thread, otherwise
your window will be unresponsive pretty much the whole time.

See http://www.pobox.com/~skeet/csharp/multithreading.html for general
advice on threading.

None of this explains why things are slowing down for you though -
unless your text box is ending up with a vast amount of text, and it's
the appending to it that's slowing you down...

What happens if you try the same code from a console app?
 
Back
Top