Query runs slow from web app, but not from management studio

  • Thread starter Thread starter Jeremy Chapman
  • Start date Start date
J

Jeremy Chapman

This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds. but when
I run the same query from my web app I get sql timeouts sometimes and other
times it's just plain slow. I've verified that both are using the same sql
server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't think
is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
ExecuteReader doesn't complete the process. You have to process the stream
by calling .Read() until there isn't any more data left, typically
accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
 
I've never knowingly seen a connection timeout, so I don't know what the
exception looks like. I've Included the timeout information below. There
is call to Read() in a while loop after the ExecuteReader call, but the
exception gets thrown on the ExecuteReader call.

reader1 = SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });
ArrayList list1 = new ArrayList();
while (reader1.Read() && reader1.HasRows)
{

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The
timeout period elapsed prior to completion of the operation or the server is
not responding.

Source Error:


An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.


Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
+45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership) +351
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) +114
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +84




W.G. Ryan - MVP said:
ExecuteReader doesn't complete the process. You have to process the stream
by calling .Read() until there isn't any more data left, typically
accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection
timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds. but
when I run the same query from my web app I get sql timeouts sometimes
and other times it's just plain slow. I've verified that both are using
the same sql server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't
think is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
My suggestion is to run Profiler and then run the app. Verify what's being
sent to the server, particularly w/ respect to the parameters.

BTW, as an aside, you can kill the &&reader1.HasRows, the
while(reader1.Read()) has the same effect. However that's not the problem.

by any chance are you using Sql Debugging?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
I've never knowingly seen a connection timeout, so I don't know what the
exception looks like. I've Included the timeout information below. There
is call to Read() in a while loop after the ExecuteReader call, but the
exception gets thrown on the ExecuteReader call.

reader1 = SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });
ArrayList list1 = new ArrayList();
while (reader1.Read() && reader1.HasRows)
{

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the
server is not responding.

Source Error:


An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
+45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership) +351
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) +114
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +84




W.G. Ryan - MVP said:
ExecuteReader doesn't complete the process. You have to process the
stream by calling .Read() until there isn't any more data left, typically
accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection
timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds. but
when I run the same query from my web app I get sql timeouts sometimes
and other times it's just plain slow. I've verified that both are using
the same sql server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't
think is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
Not using sql debugging. Runing profiler won't be easy, as the issue is
occuring on a live server, and our sever group won't let us run profiler
because of performance hits on the server.


W.G. Ryan - MVP said:
My suggestion is to run Profiler and then run the app. Verify what's being
sent to the server, particularly w/ respect to the parameters.

BTW, as an aside, you can kill the &&reader1.HasRows, the
while(reader1.Read()) has the same effect. However that's not the problem.

by any chance are you using Sql Debugging?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
I've never knowingly seen a connection timeout, so I don't know what the
exception looks like. I've Included the timeout information below.
There is call to Read() in a while loop after the ExecuteReader call, but
the exception gets thrown on the ExecuteReader call.

reader1 = SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });
ArrayList list1 = new ArrayList();
while (reader1.Read() && reader1.HasRows)
{

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the
server is not responding.

Source Error:


An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior) +45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership) +351
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) +114
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +84




W.G. Ryan - MVP said:
ExecuteReader doesn't complete the process. You have to process the
stream by calling .Read() until there isn't any more data left,
typically accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection
timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds. but
when I run the same query from my web app I get sql timeouts sometimes
and other times it's just plain slow. I've verified that both are
using the same sql server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't
think is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
Can you attach or copy a set of records to another server and change your
connection string? That would keep it off the server but should give you a
good idea about what's happening.

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
Not using sql debugging. Runing profiler won't be easy, as the issue is
occuring on a live server, and our sever group won't let us run profiler
because of performance hits on the server.


W.G. Ryan - MVP said:
My suggestion is to run Profiler and then run the app. Verify what's
being sent to the server, particularly w/ respect to the parameters.

BTW, as an aside, you can kill the &&reader1.HasRows, the
while(reader1.Read()) has the same effect. However that's not the
problem.

by any chance are you using Sql Debugging?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
I've never knowingly seen a connection timeout, so I don't know what the
exception looks like. I've Included the timeout information below.
There is call to Read() in a while loop after the ExecuteReader call,
but the exception gets thrown on the ExecuteReader call.

reader1 = SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });
ArrayList list1 = new ArrayList();
while (reader1.Read() && reader1.HasRows)
{

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.
The timeout period elapsed prior to completion of the operation or the
server is not responding.

Source Error:


An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior) +45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership) +351
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) +114
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +84




ExecuteReader doesn't complete the process. You have to process the
stream by calling .Read() until there isn't any more data left,
typically accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection
timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds.
but when I run the same query from my web app I get sql timeouts
sometimes and other times it's just plain slow. I've verified that
both are using the same sql server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't
think is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
Hi,
Did you find the solution? I have the same kind of problem. we are
using Microsoft application blocks to connect to db, and its getting
timeout.

Thanks
Srijan


Jeremy said:
I've never knowingly seen a connection timeout, so I don't know what the
exception looks like. I've Included the timeout information below. There
is call to Read() in a while loop after the ExecuteReader call, but the
exception gets thrown on the ExecuteReader call.

reader1 = SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });
ArrayList list1 = new ArrayList();
while (reader1.Read() && reader1.HasRows)
{

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The
timeout period elapsed prior to completion of the operation or the server is
not responding.

Source Error:


An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.


Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
+45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership) +351
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) +114
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +84




W.G. Ryan - MVP said:
ExecuteReader doesn't complete the process. You have to process the stream
by calling .Read() until there isn't any more data left, typically
accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection
timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds. but
when I run the same query from my web app I get sql timeouts sometimes
and other times it's just plain slow. I've verified that both are using
the same sql server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't
think is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
Hi,
Did you find the solution? I have the same kind of problem. we are
using Microsoft application blocks to connect to db, and its getting
timeout.

Thanks
Srijan


Jeremy said:
I've never knowingly seen a connection timeout, so I don't know what the
exception looks like. I've Included the timeout information below. There
is call to Read() in a while loop after the ExecuteReader call, but the
exception gets thrown on the ExecuteReader call.

reader1 = SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });
ArrayList list1 = new ArrayList();
while (reader1.Read() && reader1.HasRows)
{

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The
timeout period elapsed prior to completion of the operation or the server is
not responding.

Source Error:


An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.


Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
+45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership) +351
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) +114
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +84




W.G. Ryan - MVP said:
ExecuteReader doesn't complete the process. You have to process the stream
by calling .Read() until there isn't any more data left, typically
accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection
timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
Jeremy Chapman said:
This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds. but
when I run the same query from my web app I get sql timeouts sometimes
and other times it's just plain slow. I've verified that both are using
the same sql server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't
think is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
Not yet. Hopefully I can do some more investigation later this week.


Hi,
Did you find the solution? I have the same kind of problem. we are
using Microsoft application blocks to connect to db, and its getting
timeout.

Thanks
Srijan


Jeremy said:
I've never knowingly seen a connection timeout, so I don't know what the
exception looks like. I've Included the timeout information below.
There
is call to Read() in a while loop after the ExecuteReader call, but the
exception gets thrown on the ExecuteReader call.

reader1 = SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });
ArrayList list1 = new ArrayList();
while (reader1.Read() && reader1.HasRows)
{

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.
The
timeout period elapsed prior to completion of the operation or the server
is
not responding.

Source Error:


An unhandled exception was generated during the execution of the current
web
request. Information regarding the origin and location of the exception
can
be identified using the exception stack trace below.


Stack Trace:

[SqlException: Timeout expired. The timeout period elapsed prior to
completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior)
+45
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection
connection, SqlTransaction transaction, CommandType commandType, String
commandText, SqlParameter[] commandParameters, SqlConnectionOwnership
connectionOwnership) +351
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) +114
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +84




W.G. Ryan - MVP said:
ExecuteReader doesn't complete the process. You have to process the
stream
by calling .Read() until there isn't any more data left, typically
accopmlished by using a while loop.

However with the timeouts, are the command timeouts or connection
timeouts?

--
Cordially,

W.G. Ryan - MVP
Windows Embedded

Author - MCTS Self-Paced Training Kit (Exam 70-536)
http://www.amazon.com/gp/product/0735622779/ref=pd_ts_b_6/103-6803568-2524652?n=5&s=books&v=glance
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0735622779&itm=1
This is odd, when I run a stored procedure from query analyzer or sql
server management studio my results return within about 3 seconds.
but
when I run the same query from my web app I get sql timeouts sometimes
and other times it's just plain slow. I've verified that both are
using
the same sql server and login credentials.

I'm using the Microsoft.ApplicationBlocks.Data assembly (which I don't
think is the issue) here is the line of code that makes the call:

SqlHelper.ExecuteReader(ConnectionString.Instance.Value,
"GetMeasurementsByUser", new object[] { systemUserId, metricId });


Any ideas?
 
Back
Top