7000 rows hangs the app!

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I'm on my first ASP.net project...

I have a search page where users can enter their company name and it brings back all the related activities.

One company has 7900 something activities.

I have a RadioButtonList and SQL to bring back and display the restults.

So, I enter the company's name, brings back this 7000+ rows, displays it and then The application HANGS! ... I click on other buttons to go to other pages, but nothing happens..I can scroll down and up on the same page to look at the results but other buttons dont work...

What to do, any suggestions,ideas?
 
Can you post the way you do this?, sometimes will take a long time to the page to process all your data and then create the HTML and then send it to the browser.
Are you using datasets?, a repeater control? a datagrid?
 
I'm using "sql reader".... This is what I have:

Any suggestions,changes i need to make?

Code:
If Not Page.IsPostBack Then
            Dim cnn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnString"))
            Dim cmd As SqlCommand = cnn.CreateCommand
            cmd.CommandType = CommandType.Text

           

            cmd.CommandText = Select '<b>Incident#: </b>' + incid_id +  ' <b>Short Desc:</b>' + incid_short_desc as ID " & _
            " from ...." 

            cnn.Open()
            Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
          [b]  rblDisplayIncidents.DataSource = dr
            rblDisplayIncidents.DataBind() [/b]

                        If rblDisplayIncidents.Items.Count > 0 Then 
                rblDisplayIncidents.Visible = True
                lblIncidentCount.Visible = True
                Dim intIncidentCount = rblDisplayIncidents.Items.Count
                lblIncidentCount.Text = "# of Matches: " & intIncidentCount
                dr.Close()
                cnn.Close()

            Else
                lblNoIncident.Visible = True
                Session("noIncidentFound") = "Y"
                Response.Redirect("Incident.aspx")
            End If

        End If
 
Back
Top