dataadapter.fill slow

  • Thread starter Thread starter incolsa
  • Start date Start date
I

incolsa

When i try to fill, it takes about 25 seconds, and the sql sentence in
the analyzer only takes 1 sec.

The sentence returns 60 rows and 32 columns

sda.Fill(ds,"alojamientos");
tabla = ds.Tables["alojamientos"];

Anyone has the same problem ?

thanks
 
Can you post a more complete sample? include all the code necessary to set up
a connection and execute the query. What is the Database- SQL Server, or some
other?
Peter
 
Well, nothing as specific as this (hard to tell without much code), but yes:
I have seen queries that take 1 second actually take 30+ seconds in the app;
typically this was (after much searching) due to subtly different settings
between the analyzer and the actual code - for instance:
* ansi settings
* isolation level (OK, quite a biggie...)
* rowcount on/off
* parallelism

etc. You may be suprised what some of these will do to a query-plan. I have
even traced one down to an innocuous, simple SELECT statement that crippled
the server when part of a bigger SQL query *under this type of callinng*
(but not from the analyzer); moving it to a dedicated SP and calling EXEC to
run it solved it. Still to this day I don't know why.

Just some thoughts...

Marc
 
Back
Top