I was able to change the Connection Timeout as you suggested--confirmed
with a WriteLine--yet my application still threw a SQLException with a
timeout, even going up to 120 seconds. Running the query in SqlServer
Express takes only 30 to 35 seconds every time. Is there a second timeout
value that might be causing my problem?
On Mon, 08 May 2006 11:30:08 -0700, Willy Denoyette [MVP]
<wi*************@telenet.be> wrote:
"michael sorens" <m_********@community.nospam> wrote in message
news:op***************@spo-cont-2-dt.itron.com...
|I have used the visual designer to create a series of DataGridViews
| populated from SQLServer data.
| A typical call is:
|
| myCountsTableAdapter.Fill(myDataSet.myCounts);
|
| My application actually connects to different systems during a run; on
| some of these the default timeout is adequate, but on one system I get
an
| SQL exception that simply reports "Timeout expired". The default
timeout
| shows as "15" using this line of code.
|
| Console.WriteLine("timeout = "
| + myCountsTableAdapter.Connection.ConnectionTimeout) ;
|
| But this property is read-only; how can I change it?
Set the timeout in your connection string....
..., Connection Timeout=30,...
Check msdn for other ConnectionString keywords.
Willy.