I have a SQL statement that executes fine when I run it in SQL Management Studio on the SQL 2008 server. However, when I run it in my Visual Basic 2008 program on a remote machine, it works part of the time and other times it gets the error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." I'm guessing that I need to put a timeout value in my VB code, but I don't know how. I'm using a dataset to get the data.