[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

operation cancelled by user

Posted on 2005-04-28
8
Medium Priority
?
493 Views
Last Modified: 2008-01-16
I have an asp.net datagrid binding from a sql server stored procedure query. When the number of records passes a certain point (not much ~50-100 records), I am getting the error "operation cancelled by user" on the datagrid.databind line. I set the sessionState timeout very high (3000), and switched from a remote database to a local one. What could be going on here?
0
Comment
Question by:lcftahoe
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:praneetha
ID: 13889096
r u using threading by any chance...

can u post the code...
0
 

Author Comment

by:lcftahoe
ID: 13889173
no threading, pretty simple code...

Private Sub loadGrid(ByVal dbConn As DB)
        Dim rdGet As SqlDataReader

        rdGet = dbConn.getActivities

        grdActivities.DataSource = rdGet
        grdActivities.DataBind()

        rdGet.Close()

        If grdActivities.Items.Count = 0 Then
            grdActivities.Visible = False
            lblActivity.Text = "No Activities Found"
            lblActivity.Visible = True
        Else
            grdActivities.Visible = True
            lblActivity.Visible = False
        End If
    End Sub

[and from the DB object:]

Public Function getActivities() As SqlDataReader
        'GETS ALL ACTIVITIES
        'RETURNS activity_id,activity_type, title, description, active, location,URL, phone, address, map_url, type_description
        'ORDERED BY type_description, title

        Dim rdGet As SqlDataReader
        Dim cmdGet As New SqlCommand()

        cmdGet.Connection = connData
        cmdGet.CommandType = CommandType.StoredProcedure
        cmdGet.CommandText = "getActivities"


        rdGet = cmdGet.ExecuteReader


        cmdGet.Cancel()

        Return rdGet

    End Function
0
 

Author Comment

by:lcftahoe
ID: 13889206
ps I tried loading the site on a different web server and seeing the same problem so it seems like a project setting I'm missing or code issue not a server issue???
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 15

Expert Comment

by:praneetha
ID: 13889256

        cmdGet.Cancel() looks like bcz of that...
0
 
LVL 15

Expert Comment

by:praneetha
ID: 13889285
 Dim rdGet As SqlDataReader
        Dim cmdGet As New SqlCommand()

        cmdGet.Connection = connData
        cmdGet.CommandType = CommandType.StoredProcedure
        cmdGet.CommandText = "getActivities"


        rdGet = cmdGet.ExecuteReader(CommandBehavior.CloseConnection)

       Return rdGet

i guess that's what u need to do...

where is the conn object..like SQLConnection ...and myconnection.Open()
0
 

Author Comment

by:lcftahoe
ID: 13889941
Hmmm... ok got rid of the cmdGet.cancel and it is loading ok now. This has been somewhat sporadic though so let me watch that for awhile before I close the issue. Can you explain why this would cause this behavior sporadically and/or only when the amount of records returned reached a certain point - want to understand this for the future!
0
 
LVL 15

Accepted Solution

by:
praneetha earned 2000 total points
ID: 13889977
well may be it hit that statement (Cancel)....if it fetched all the rows than it wouldnt affect...but if it is still processing that execute reader and it hits the cancel button..it's like u r cancelling the job...and i think you shold never really use cancel..i mean why would u need it..why would u need to cancel it...

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question