PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Query runs slow from web app, but not from management studio
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Query runs slow from web app, but not from management studio
![]() |
Query runs slow from web app, but not from management studio |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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/07...=books&v=glance http://search.barnesandnoble.com/bo...735622779&itm=1 "Jeremy Chapman" <please@Idontlikespam> wrote in message news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... > 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? > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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" <WilliamRyan@nospam.gmail.com> wrote in message news:%23f1C%23jIlGHA.1320@TK2MSFTNGP04.phx.gbl... > 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/07...=books&v=glance > http://search.barnesandnoble.com/bo...735622779&itm=1 > "Jeremy Chapman" <please@Idontlikespam> wrote in message > news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... >> 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? >> > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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/07...=books&v=glance http://search.barnesandnoble.com/bo...735622779&itm=1 "Jeremy Chapman" <please@Idontlikespam> wrote in message news:uBUP$FJlGHA.5072@TK2MSFTNGP04.phx.gbl... > 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" <WilliamRyan@nospam.gmail.com> wrote in message > news:%23f1C%23jIlGHA.1320@TK2MSFTNGP04.phx.gbl... >> 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/07...=books&v=glance >> http://search.barnesandnoble.com/bo...735622779&itm=1 >> "Jeremy Chapman" <please@Idontlikespam> wrote in message >> news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... >>> 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? >>> >> >> > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
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" <WilliamRyan@nospam.gmail.com> wrote in message news:e25mf6JlGHA.3924@TK2MSFTNGP03.phx.gbl... > 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/07...=books&v=glance > http://search.barnesandnoble.com/bo...735622779&itm=1 > "Jeremy Chapman" <please@Idontlikespam> wrote in message > news:uBUP$FJlGHA.5072@TK2MSFTNGP04.phx.gbl... >> 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" <WilliamRyan@nospam.gmail.com> wrote in message >> news:%23f1C%23jIlGHA.1320@TK2MSFTNGP04.phx.gbl... >>> 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/07...=books&v=glance >>> http://search.barnesandnoble.com/bo...735622779&itm=1 >>> "Jeremy Chapman" <please@Idontlikespam> wrote in message >>> news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... >>>> 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? >>>> >>> >>> >> >> > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
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/07...=books&v=glance http://search.barnesandnoble.com/bo...735622779&itm=1 "Jeremy Chapman" <please@Idontlikespam> wrote in message news:uWnjcdKlGHA.4872@TK2MSFTNGP04.phx.gbl... > 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" <WilliamRyan@nospam.gmail.com> wrote in message > news:e25mf6JlGHA.3924@TK2MSFTNGP03.phx.gbl... >> 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/07...=books&v=glance >> http://search.barnesandnoble.com/bo...735622779&itm=1 >> "Jeremy Chapman" <please@Idontlikespam> wrote in message >> news:uBUP$FJlGHA.5072@TK2MSFTNGP04.phx.gbl... >>> 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" <WilliamRyan@nospam.gmail.com> wrote in message >>> news:%23f1C%23jIlGHA.1320@TK2MSFTNGP04.phx.gbl... >>>> 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/07...=books&v=glance >>>> http://search.barnesandnoble.com/bo...735622779&itm=1 >>>> "Jeremy Chapman" <please@Idontlikespam> wrote in message >>>> news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... >>>>> 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? >>>>> >>>> >>>> >>> >>> >> >> > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
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 Chapman wrote: > 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" <WilliamRyan@nospam.gmail.com> wrote in message > news:%23f1C%23jIlGHA.1320@TK2MSFTNGP04.phx.gbl... > > 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/07...=books&v=glance > > http://search.barnesandnoble.com/bo...735622779&itm=1 > > "Jeremy Chapman" <please@Idontlikespam> wrote in message > > news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... > >> 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? > >> > > > > |
|
|
|
#8 |
|
Guest
Posts: n/a
|
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 Chapman wrote: > 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" <WilliamRyan@nospam.gmail.com> wrote in message > news:%23f1C%23jIlGHA.1320@TK2MSFTNGP04.phx.gbl... > > 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/07...=books&v=glance > > http://search.barnesandnoble.com/bo...735622779&itm=1 > > "Jeremy Chapman" <please@Idontlikespam> wrote in message > > news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... > >> 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? > >> > > > > |
|
|
|
#9 |
|
Guest
Posts: n/a
|
Not yet. Hopefully I can do some more investigation later this week.
<srijan321@gmail.com> wrote in message news:1151336068.056905.232300@p79g2000cwp.googlegroups.com... > 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 Chapman wrote: >> 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" <WilliamRyan@nospam.gmail.com> wrote in message >> news:%23f1C%23jIlGHA.1320@TK2MSFTNGP04.phx.gbl... >> > 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/07...=books&v=glance >> > http://search.barnesandnoble.com/bo...735622779&itm=1 >> > "Jeremy Chapman" <please@Idontlikespam> wrote in message >> > news:%23MpqMbIlGHA.2280@TK2MSFTNGP02.phx.gbl... >> >> 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? >> >> >> > >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

