Trubleshoot SQL timeout message

I have a very basic program that reads a csv file into a SQL table, runs a couple of queries on that table and then reads that data and writes the converted data back to an output csv file.  On my development computer all works fine. However, when I drop it into production right after reading in the data I get this exception error message:

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0

        private void btnScrub_FileClick(object sender, EventArgs e)
            lblProcessing.Text = "Processing starting ... please wait.";


            Input_CSV_File();     /* Insert the data into SQL */


            Output_CSV_File();      /* Extract the data from SQL and write only required fields to the csv file */


Please cancel this question. I ran the query directly in SQL and discovered their tempdb was consuming all the disk space.

I do not know how to even troubleshoot something like this. I have increased the connection timeout for the SQL connection but that cannot be it because I open it and leave it open until the routine closes. I am wondering if it has something to do with the Application.DoEvents method? I do have a progress bar in the code and use this to see the progress bar progress. By the way, the production computer is much slower than my development computer. In development the entire process takes about 60 seconds. In production it takes about 12 minutes.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Máté FarkasDatabase Developer and AdministratorCommented:
Some comments:
- You should debug which step takes longer or timed out ( Input_CSV_File, Update_Codes or Output_CSV_File)
- You should increase command timeout instead of connection timeout
- You should make sure that your process streams data from CSV into database instead of parsing/loading the entire file into memory first
- You should monitor processes on server side during this program with SELECT * FROM sys.sysprocesses

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rwheeler23Author Commented:
Good tips.  I actually ran the update query directly in SQL and it crashed there as well because the tempdb grew to a ridiculous size.
rwheeler23Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.