Advertisement

02.07.2008 at 02:02PM PST, ID: 23146138
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

ASP.NET 2.0 page freezes or times out when running a routine

Asked by bd9000 in Programming for ASP.NET, Microsoft Visual Basic.Net, .NET Framework 2.x

Tags:

I have a page that runs a routine that can take from 1 minute to 2 hours to run (depending on the size of the datafile).
It reads in line-by-line a text file of account names & email addresses, then sends a message to the email address and then updates a database log table.   After only a couple of minutes, the page times out.  Before it times out, the page is frozen.
I'd like to give control back to the user immediately after the button starting the process is clicked.
I presume this is a multithreading issue, but I'm not sure how to implement this via a webpage.
How do I go about this?
  Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
Private Sub ParseEmailList(ByVal filepathandname As String)
            Dim sr As StreamReader
            Dim EmailsSentWithoutErrors As Integer = 0
            If File.Exists(filepathandname) Then
                sr = File.OpenText(filepathandname)
                Try
                    Dim columnnames As String = sr.ReadLine.Replace(Chr(34), "") 'need to read in the first line
                    Dim arycolumnnames As Array = columnnames.Split(",")
                    Do Until sr.EndOfStream
                        'read a line, set the variables
                        Dim line As String = sr.ReadLine.Replace("[", "").Replace("]", "").Replace(Chr(34), "")
                        Dim aryline As Array = line.Split(",")
 
                        'create a copy of the HTML file in memory
                        Dim msg As String = Me.txtEmailTemplate.Text.Trim
                        'replace tokens
                        For x As Integer = 0 To arycolumnnames.Length - 1
                            msg = msg.Replace(arycolumnnames(x), aryline(x))
                        Next
                        'now send the email
                        Dim guid As String = aryline(7).ToString
                        Dim campaignid As String = aryline(5).ToString
                        Dim email As String = aryline(0).ToString
                        Dim name As String = aryline(1).ToString & " " & aryline(2).ToString
 
                        SendMail(Me.txtSubject.Text, msg, True, Me.txtFromEmailAddress.Text.Trim, Me.txtFromName.Text.Trim, email, name, "", "mail.mywebsite.com")
 
                        ExecuteSQL("CampaignLogInsert '" & campaignid & "','" & guid & "'")
                        Delay(Convert.ToUInt32(Me.txtSendDelay.Text.Trim))
                        EmailsSentWithoutErrors += 1
                    Loop
                Catch ex As Exception
 
                Finally
                    sr.Close()
                End Try
            End If
        End Sub
 
 
Loading Advertisement...
 
[+][-]02.07.2008 at 03:39PM PST, ID: 20846561

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.08.2008 at 03:00PM PST, ID: 20855005

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.08.2008 at 04:20PM PST, ID: 20855536

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Microsoft Visual Basic.Net, .NET Framework 2.x
Tags: ASP.NET 2.0, VB.NET 2.0
Sign Up Now!
Solution Provided By: GreenGhost
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.26.2008 at 05:22PM PST, ID: 20990591

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 05:38PM PST, ID: 20990657

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 05:38PM PST, ID: 20990660

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628