title: Can you trace the source for a Timeout expired error?
body: <p>I have two identical sql server databases - staging (version 10.0.4000.0) and testing (10.0.2531.0).<br>
  I have a Visual Studio 2008 ASP.Net, C# project that calls these databases.  The project uses .xsd to return data from stored procedures.  </p>
  
  <p>There are over 100 stored procedures in this project and everything works great. However, I recently created a stored procedure that is giving me issues.  The stored procedure runs in both databases from QA.  When I create the table adpater for the xsd and connect it to the testing db, it runs as expected.  When I change the connection to the staging db, I get this error:</p>
  
  <blockquote>
    <p>Timeout expired.  The timeout period elapsed prior to completion of
    the operation or the server is not responding.</p>
  </blockquote>
  
  <p>The procedure requires two date parameters.  If I remove the date paramters, the error goes away and I get the expected result set.  If I put in a bogus string or integer parameter, it also runs.  But if I require dates, the timeout error occurs.  Keep in mind that the stored procedures are identical in test and staging and both return results (in 3 seconds) when run in QA.  I'm just clicking on the tableadapter and selecting the preview data option so I know this can't be some mistake in my presentation code.</p>
  
  <p>I'm not sure what code to provide or what might help solve this issue.  Please let me know what details may help and I can provide.</p>
  
  <p><strong>UPDATE</strong>:
  Here is the full message returned from Visual Studio:</p>
  
  <blockquote>
    <p>MW.MWDeptTotalSpend.Fill,GetData (@StartPYMNT_DT, @EndPYMNT_DT) could
    not be previewed.</p>
    
    <p>Timeout expired.  The timeout period elapsed prior to completion of
    the operation or the server is not responding.</p>
  </blockquote>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>I made a small change in my sproc that may give some insight.  </p>
  
  <pre><code>WHERE X.PYMNT_DT BETWEEN '1/1/2014' and '5/1/2014' --@StartPYMNT_DT AND @EndPYMNT_DT
  </code></pre>
  
  <p>The commented parameters are defined @StartPYMNT_DT smalldatetime, @EndPYMNT_DT smalldatetime</p>
  
  <p>The procedure returns data now, but obviously I want to pass in my date parameters.</p>