﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum / StrataFrame Application Framework / Business Objects and Data Access (How do I?)  / Increase Connection Timeout / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Sun, 07 Sep 2008 16:54:09 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Thanks.  Took me a minute to make the right connection from the command to the BO.  Here is my revised code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ADUserBO&lt;/FONT&gt;&lt;FONT size=2&gt; mADUser = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ADUserBO&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; mPartNum = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (PartNumCBE.SelectedValue != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;{&lt;BR&gt;    mPartNum = (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)PartNumCBE.SelectedValue;&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlCommand&lt;/FONT&gt;&lt;FONT size=2&gt; cmd = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlCommand&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"spx_GetRunningInventory_FinishedGoods"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;cmd.CommandTimeout = 0;&lt;BR&gt;cmd.Parameters.AddWithValue(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@partnum"&lt;/FONT&gt;&lt;FONT size=2&gt;, mPartNum).SqlDbType = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlDbType&lt;/FONT&gt;&lt;FONT size=2&gt;.VarChar;&lt;BR&gt;cmd.Parameters.AddWithValue(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@div"&lt;/FONT&gt;&lt;FONT size=2&gt;, mADUser.LocationIndex).SqlDbType = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlDbType&lt;/FONT&gt;&lt;FONT size=2&gt;.Int;&lt;BR&gt;cmd.Parameters.AddWithValue(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@invdate"&lt;/FONT&gt;&lt;FONT size=2&gt;, InvDateDE.DateTime.ToShortDateString()).SqlDbType = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlDbType&lt;/FONT&gt;&lt;FONT size=2&gt;.VarChar;&lt;BR&gt;cmd.CommandType = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;CommandType&lt;/FONT&gt;&lt;FONT size=2&gt;.StoredProcedure;&lt;BR&gt;rawMaterialValuationBO1.FillDataTable(cmd);&lt;BR&gt;gridView1.Columns[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"CurrQty"&lt;/FONT&gt;&lt;FONT size=2&gt;].FilterInfo = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; DevExpress.XtraGrid.Columns.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ColumnFilterInfo&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"CurrQty &amp;gt; 0"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;gridView1.ApplyColumnsFilter();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Works great!  Thanks a bunch.  Oh...and the wait &amp;#119;indow...awefully nice feature!!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Now, I just need to work on getting that sproc to run faster than 90 seconds.  It has several nested CASE statements that I think are gumming up the works.  Not too sure how to simplify those conversions that are going on.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Happy Friday!&lt;BR&gt;Bill&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 09 May 2008 11:06:20 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>[quote]If the command timeout can be set, how do I do that from the BO?[/quote]&lt;/P&gt;&lt;P&gt;Through a command:&lt;/P&gt;&lt;P&gt;[codesnippet]'-- Establish Locals&lt;BR&gt;Dim cmd As New SqlCommand("MyStoredSproc")&lt;/P&gt;&lt;P&gt;'-- Never time out&lt;BR&gt;cmd.CommandTimeout = 0&lt;/P&gt;&lt;P&gt;'-- Set the parms&lt;BR&gt;cmd.Parameters.AddWithValue("@Parm1", 1).SqlDbType = SqlDbType.Int&lt;/P&gt;&lt;P&gt;'-- Set the command type&lt;BR&gt;cmd.CommandType = CommandType.StoredProcedure&lt;/P&gt;&lt;P&gt;'-- Execute the command&lt;BR&gt;Me.ExecuteNonQuery(cmd)[/codesnippet]</description><pubDate>Fri, 09 May 2008 09:52:02 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Thanks Paul and Edhy!!&lt;/P&gt;&lt;P&gt;I am still using SQL Server 2000...I will see if I can find a corresponding configuration for setting the timeout.&lt;/P&gt;&lt;P&gt;Here is my code that I use for retrieving the data:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; mPartNum = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (PartNumCBE.SelectedValue != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;{&lt;BR&gt;    mPartNum = (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)PartNumCBE.SelectedValue;&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt; mItemCode = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@partnum"&lt;/FONT&gt;&lt;FONT size=2&gt;, mPartNum);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ADUserBO&lt;/FONT&gt;&lt;FONT size=2&gt; mADUser = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ADUserBO&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt; mDiv = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@div"&lt;/FONT&gt;&lt;FONT size=2&gt;, mADUser.LocationIndex);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt; mInvDate = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SqlParameter&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"@invdate"&lt;/FONT&gt;&lt;FONT size=2&gt;, InvDateDE.DateTime.ToShortDateString());&lt;BR&gt;rawMaterialValuationBO1.FillByStoredProcedure(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"spx_GetRunningInventory_FinishedGoods"&lt;/FONT&gt;&lt;FONT size=2&gt;, mItemCode, mDiv, mInvDate);&lt;BR&gt;gridView1.Columns[&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"CurrQty"&lt;/FONT&gt;&lt;FONT size=2&gt;].FilterInfo = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; DevExpress.XtraGrid.Columns.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ColumnFilterInfo&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"CurrQty &amp;gt; 0"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;BR&gt;gridView1.ApplyColumnsFilter();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;If the command timeout can be set, how do I do that from the BO?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Thanks,&lt;BR&gt;Bill&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 09 May 2008 09:36:04 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Yeah, Paul nailed it on the last post.  The most common timeout that is overlooked is on the command itself.  You can set the connection timeout until you are blue in the face...but if you don't set the command time out it can still timeout on you.  So if you set the command timeout you should be good to go! :)</description><pubDate>Fri, 09 May 2008 09:24:01 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Bill,&lt;/P&gt;&lt;P&gt;I thought that I had found where to set it on a per query basis, I set it server wide to deal with an issue with E-connect for Great Plains, to set in on a per query basis simply set the commandtimeout property of the Sql Command.&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; loCommand &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SqlCommand()&lt;/P&gt;&lt;P&gt;loCommand.CommandTimeout = 150&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'-- Build the Query&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;loCommand.CommandText = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"SELECT * FROM WHATEVER"&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Fri, 09 May 2008 07:38:43 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Bill,&lt;/P&gt;&lt;P&gt;You can set the remote query timeout on the server, I had to change this when I was doing some import operations from my old foxpro data to Sql. I'm not sure if there is a way to change it ona per query basis but this did work for me with the same error.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/e87ea597-7846-4d6a-b47d-1f79.png"&gt;</description><pubDate>Fri, 09 May 2008 07:18:03 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Hi Bill,&lt;/P&gt;&lt;P&gt;I found a thread that may give you an idea about using a separate thread for your query.  Check it here: &lt;A href="http://forum.strataframe.net/FindPost11979.aspx"&gt;http://forum.strataframe.net/FindPost11979.aspx&lt;/A&gt;</description><pubDate>Thu, 08 May 2008 22:18:34 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Here is the error:&lt;/P&gt;&lt;P&gt;"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."&lt;/P&gt;&lt;P&gt;My query has been timed at about 90 seconds.  What can I do to get StrataFrame to increase this timeout?&lt;/P&gt;&lt;P&gt;Thanks!!</description><pubDate>Thu, 08 May 2008 18:50:19 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>Perhaps I should have title this thread: Increase Query Timeout</description><pubDate>Thu, 08 May 2008 18:33:18 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>Increase Connection Timeout</title><link>http://forum.strataframe.net/Topic16265-6-1.aspx</link><description>I have a query that is taking about 90 seconds.  The window times out before any data is displayed.  How do I increase the connection timeout for this query?&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR&gt;Bill</description><pubDate>Thu, 08 May 2008 17:58:22 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item></channel></rss>