PDA

View Full Version : Help with webservices and .Net



Sooner in Tampa
11/13/2006, 11:45 AM
I am building a web application using Visual Studio 2005, I am working with the GridView. I am pulling my data via a webservice from a SQL server. I am not sure on the version of SQL, but I think it 2005. I am coding in C#.

The question I have is this: I am pulling over 4,000 records into my GridView...it takes roughly 28 seconds to fill the grid, and each time I do something as simple as hit page 2...it takes another 28 seconds...can I cache such a large amount of data?
I really want to cache the info for manipulation (i.e. edit, delete, or sort)...the GridView is really good for this, but with so many records it is killing my performance.

I have even tried an ObjectDataSet and programmatically building a DataTable...but it is still slow as crap.

p.s. I have only been doing this for a short while so be gentle.

Vaevictis
11/13/2006, 01:39 PM
Heh, at 28 seconds each time, it sounds like maybe you don't have much choice about caching it if you really need to pull all 4k records.

But that begs the question: Do you really need to pull all 4k records?

Vaevictis
11/13/2006, 01:47 PM
The other question I'd ask at this point is, do you know where the bottleneck is?

Is it in the GridView class sucking in the data, is it in the code extracting it from internal data structures to present it to the end user, is it the network transferring the data, is it in the SQL server doing the query?

Sooner in Tampa
11/13/2006, 01:48 PM
Heh, at 28 seconds each time, it sounds like maybe you don't have much choice about caching it if you really need to pull all 4k records.

But that begs the question: Do you really need to pull all 4k records?Ultimately, I would hope that we can somehow widdle this down. Right now we are working a worst case scenario. We really thought the GridView would be an assist...it is suppose to be better than the old DataSet.
I have been reading developer websites all day and I am not seeing much out there for this type of problem.
There has to be a way that we get the records into a "set" and not require another trip back to the server.

I have tried to "EnablePagingandCallbacks" on the GridView properties, but that screws up the whole page...then when I try and call another page...I get NADA. :mad:

Sooner in Tampa
11/13/2006, 01:50 PM
The other question I'd ask at this point is, do you know where the bottleneck is?

Is it in the GridView class sucking in the data, is it in the code extracting it from internal data structures to present it to the end user, is it the network transferring the data, is it in the SQL server doing the query?I don't think it is the GridView. We added the ObjectDataSource and built a table programmatically...but that made it even slower.

Could it be the webservice?

Vaevictis
11/13/2006, 01:54 PM
I have no idea. I don't know very much at all about GridView -- I'm just asking you the standard questions I ask myself when I go about solving one of these problems, trying to narrow it down.

The first thing you really need to do is identify where the bottleneck(s) is (are) before you can really start addressing the problem.

For example, if your SQL server is spending 20 seconds executing the query before handing you the data, then not much you do on the webservice side is going to help (other than doing an easier/better query).

jkm, the stolen pifwafwi
11/13/2006, 06:29 PM
2 choices -> make the gridview snapshot the data or pull it down and use ajax. if they will page through a ton of data, i'd use the latter, most likely the former is all you need.

jkm, the stolen pifwafwi
11/13/2006, 06:31 PM
ah, i guess i should have read your problem. call the webservice as a dataset and bind it to the grid using ajax. this will send the xml file as part of the page and won't use callbacks.

jkm, the stolen pifwafwi
11/13/2006, 06:32 PM
oh, and i would highly advise you getting the infragistics web control set for this kind of thing. way more efficient at handling this than the out of the box microsoft stuff...

soonerboomer93
11/13/2006, 06:51 PM
just delete everything beyond the first 4k records