title: Why might a stored procedure take longer to execute from a VB.net application than from SSMS?
body: <p>I have created a winforms application which pulls data from a database. During development, (using a SQL server on the same machine), but once released, there seems to be a significant delay retrieving the data from the remote server. The dev and release servers have almost identical data, so that shouldn't be an issue. </p>
  
  <p>I think that I have narrowed the problem down to one call to a stored procedure.</p>
  
  <p>Using the SQL Profiler on the release server, it shows that it takes almost 17 seconds to run the stored proc, when it is called from my application, but only a tiny fraction of this when run from SSMS:</p>
  
  <p><a href="https://i.stack.imgur.com/oKpEL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oKpEL.png" alt="enter image description here"></a> </p>
  
  <p>My question is, what could be causing this behavior? Or what can I do next to try and diagnose the problem further?</p>