473,756 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timeout while executing stored procedure from VB.net

See below the code for details about the scenario.
------------------------------------------------------------------------------------

Public WithEvents conADS As New SqlConnection(" Data
Source=server;I nitial Catalog=db;Pers ist Security Info=True;User
ID=username;Pas sword=password; Connection Timeout=0;")

Public runBoardPosting s As New SqlCommand("EXE C [dbo].
[nwinsight_all_t eams_commission _report_summary] @PREV2_PERIOD_S TART =
@prev2Begin, @PREV2_PERIOD_E ND = @prev2End, @PREV2_CUTOFF_D ATE =
@prev2Cut, @PREV_PERIOD_ST ART = @prevBegin, @PREV_PERIOD_EN D =
@prevEnd, @PREV_CUTOFF_DA TE = @prevCut, @CUR_PERIOD_STA RT = @curStart,
@CUR_PERIOD_END = @curEnd, @CUR_CUTOFF_DAT E = @curCut", conADS)

Public BoardPostingsDR As SqlDataReader

conADS.Open()
conReports.Open ()
getReportInfo.P arameters.Clear ()
getReportInfo.P arameters.AddWi thValue("@thisR eport",
reportID)
ReportInfoDR = getReportInfo.E xecuteReader
With ReportInfoDR
Try
.Read()
curBegin = .GetValue(0) : curEnd = .GetValue(1) :
curCut = .GetValue(2)
prevBegin = .GetValue(3) : prevEnd
= .GetValue(4) : prevCut = .GetValue(5)
prev2Begin = .GetValue(6) : prev2End
= .GetValue(7) : prev2Cut = .GetValue(8)
ReportInfoDR.Cl ose()
runBoardPosting s.Parameters.Cl ear()

runBoardPosting s.Parameters.Ad dWithValue("@pr ev2Begin", prev2Begin)

runBoardPosting s.Parameters.Ad dWithValue("@pr ev2End", prev2Begin)

runBoardPosting s.Parameters.Ad dWithValue("@pr ev2Cut", prev2Begin)

runBoardPosting s.Parameters.Ad dWithValue("@pr evBegin", prevBegin)

runBoardPosting s.Parameters.Ad dWithValue("@pr evEnd", prevEnd)

runBoardPosting s.Parameters.Ad dWithValue("@pr evCut", prevCut)

runBoardPosting s.Parameters.Ad dWithValue("@cu rStart", curBegin)

runBoardPosting s.Parameters.Ad dWithValue("@cu rEnd", curEnd)

runBoardPosting s.Parameters.Ad dWithValue("@cu rCut", curCut)
----- BoardPostingsDR = runBoardPosting s.ExecuteReader

GoTo step2
Catch ex As Exception
Exit Sub
End Try

The arrow marks the spot where the exception occurs.

The stored procedure takes about 5 minutes to run, it querys 15-20
tables and compiles the data into a single table for return. I am
trying to take this table and write it into another database on a
different server, along with some other values that have been pre-
determined. Would anybody be kind enough to help me out with this
dillemma?? I thank you in advance for your anticipated help!

Feb 21 '07 #1
2 7280
In addition to the timeout property on the connection, there is a timeout
property on the command object. Give that a try.

Robin S.
-------------------------
<dr****@nelsonw atson.comwrote in message
news:11******** **************@ k78g2000cwa.goo glegroups.com.. .
See below the code for details about the scenario.
------------------------------------------------------------------------------------

Public WithEvents conADS As New SqlConnection(" Data
Source=server;I nitial Catalog=db;Pers ist Security Info=True;User
ID=username;Pas sword=password; Connection Timeout=0;")

Public runBoardPosting s As New SqlCommand("EXE C [dbo].
[nwinsight_all_t eams_commission _report_summary] @PREV2_PERIOD_S TART =
@prev2Begin, @PREV2_PERIOD_E ND = @prev2End, @PREV2_CUTOFF_D ATE =
@prev2Cut, @PREV_PERIOD_ST ART = @prevBegin, @PREV_PERIOD_EN D =
@prevEnd, @PREV_CUTOFF_DA TE = @prevCut, @CUR_PERIOD_STA RT = @curStart,
@CUR_PERIOD_END = @curEnd, @CUR_CUTOFF_DAT E = @curCut", conADS)

Public BoardPostingsDR As SqlDataReader

conADS.Open()
conReports.Open ()
getReportInfo.P arameters.Clear ()
getReportInfo.P arameters.AddWi thValue("@thisR eport",
reportID)
ReportInfoDR = getReportInfo.E xecuteReader
With ReportInfoDR
Try
.Read()
curBegin = .GetValue(0) : curEnd = .GetValue(1) :
curCut = .GetValue(2)
prevBegin = .GetValue(3) : prevEnd
= .GetValue(4) : prevCut = .GetValue(5)
prev2Begin = .GetValue(6) : prev2End
= .GetValue(7) : prev2Cut = .GetValue(8)
ReportInfoDR.Cl ose()
runBoardPosting s.Parameters.Cl ear()

runBoardPosting s.Parameters.Ad dWithValue("@pr ev2Begin", prev2Begin)

runBoardPosting s.Parameters.Ad dWithValue("@pr ev2End", prev2Begin)

runBoardPosting s.Parameters.Ad dWithValue("@pr ev2Cut", prev2Begin)

runBoardPosting s.Parameters.Ad dWithValue("@pr evBegin", prevBegin)

runBoardPosting s.Parameters.Ad dWithValue("@pr evEnd", prevEnd)

runBoardPosting s.Parameters.Ad dWithValue("@pr evCut", prevCut)

runBoardPosting s.Parameters.Ad dWithValue("@cu rStart", curBegin)

runBoardPosting s.Parameters.Ad dWithValue("@cu rEnd", curEnd)

runBoardPosting s.Parameters.Ad dWithValue("@cu rCut", curCut)
----- BoardPostingsDR = runBoardPosting s.ExecuteReader

GoTo step2
Catch ex As Exception
Exit Sub
End Try

The arrow marks the spot where the exception occurs.

The stored procedure takes about 5 minutes to run, it querys 15-20
tables and compiles the data into a single table for return. I am
trying to take this table and write it into another database on a
different server, along with some other values that have been pre-
determined. Would anybody be kind enough to help me out with this
dillemma?? I thank you in advance for your anticipated help!


Feb 21 '07 #2
<dr****@nelsonw atson.comschrie b
See below the code for details about the scenario.
------------------------------------------------------------------------------------

Public WithEvents conADS As New SqlConnection(" Data
Source=server;I nitial Catalog=db;Pers ist Security Info=True;User
ID=username;Pas sword=password; Connection Timeout=0;")

Public runBoardPosting s As New SqlCommand("EXE C [dbo].
[nwinsight_all_t eams_commission _report_summary] @PREV2_PERIOD_S TART
= @prev2Begin, @PREV2_PERIOD_E ND = @prev2End, @PREV2_CUTOFF_D ATE =
@prev2Cut, @PREV_PERIOD_ST ART = @prevBegin, @PREV_PERIOD_EN D =
@prevEnd, @PREV_CUTOFF_DA TE = @prevCut, @CUR_PERIOD_STA RT =
@curStart, @CUR_PERIOD_END = @curEnd, @CUR_CUTOFF_DAT E = @curCut",
conADS)

runBoardPosting s.CommandTimeou t = <whatever>
Armin

Feb 21 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
7593
by: David Berry | last post by:
Hi All. I have a SQL Statement on an ASP page that only returns 4 records. When I run it in SQL Server or Query Analyzer it runs in less than a second. When I run it from my ASP page I get: Microsoft OLE DB Provider for SQL Server error '80040e31' Timeout expired the error line points to the rs.Open sql,con line. The SQL Statement is:
3
6113
by: DarthMacgyver | last post by:
Hello, I recently wrote a survey application. Each question is very similar. The first questions gives me a problem when there are multiple people taking the survey (The Database connection Timed out) I am using the Data Access Application Blocks as ASP.NET (using VB.NET) and SQL 2000. In there first question there can be up to 27 answers. So I figured instead of making 27 different trips to the database I woulc just concatenate my...
4
12639
by: Manoj K | last post by:
Environment:- Framework 1.1 DB: SQL Server 2000 (SQL Provider) OS: Windows 2000 Language: VB.NET I'm trying to do mass inserts/updates. Using Transactions. The table hierarchy contains 3 levels (TL1, TL2, and TL3): Here is what I'm trying to accomplish:
1
12202
by: Ville Huovinen | last post by:
Platform: Windows 2003 Server (MS SQL Server 2003 SP3) Language: C# Problem: My stored procedures times out randomly, some proces works fine when using them from C#, and some generate SqlException which states that the server has timed out. The problem isn't in server, neither in stored procedures because they work fine in Sql Server's enterprise manager, but when calling from code they are slow and take about 60 seconds before...
5
13276
by: Jason | last post by:
Hi all I get the following error when executing a rather intense stored procedure from an ASPX page. I have tried: - Increasing timeouts on IIS 5.0 (all areas that even mention timeout) - use the "Connection Timeout=2400" string in the SqlConnection connections string - disabled connection pooling.
3
13992
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection connection = new SqlConnection(ConfigurationSettings.AppSettings)) {
6
5187
by: archana | last post by:
Hi all, I am executing one stored procedure in windows service. I set sqlcommad's CommandTimeout to 432000 which means 5 days timeout. Still after 11th hour i am getting timeout. I am not getting if i set timeout as 5 days why i am getting timeout before that. Please shed some light on it.
4
1472
by: James | last post by:
How can I see/set the timeout for a postback? I have a button click event which loops through a DataSet and calls a stored procedure for every record in the dataset. This can be a very large number, and locally it's working fine. However, when I move to our development server, the exact same code pointing to the same database redirects to a Page Cannot Be Displayed after a finite period of time. I'd like to bump up the "timeout" if...
6
1689
by: si_owen | last post by:
Hi Guys, I am running visual studio 2005 with asp.net v2. I am calling records back from a database over a time period. The application works great over a time period of less than 2 months, however for over 2 months I get the following error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
0
10046
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9886
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9722
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.