General Question About DataSet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi all.
in my dev team we have an argument about retrieving Records from DB to
DataSet.
the big question is: should i retrieve all the records from my table (max
4000 records) to my DataSet, and then, inside the client i'll filter a
DataView, or should i filter the records in the SqlComand, and then, inside
the client, when it's filter time ,i'll go to the DB again with another
filter.
some developers say that if i hold a DataSet, filled with a lot of records
it will slow down the application and effect my pc's virtual memory, and
others say that this is the "correct" way to do, inorder to save round trips
to the DataBase.
so - what's the correct way to do it?
** i know it's diffrent between application's, but i ask in general.
thanks.
 
Both ways are correct.

I, personally, would consider 4,000 rows to be a small number but it depends
upon what makes each row. However, if each row contains a number of BLOB
columns then that is a different matter.

Other factors need to be considered. Network latency, load on the database
server, how often and how quickly the application needs to access the data
are just some factors, what other applications are running on the PC are
just some.

It's really a matter of finding what works best for you in a given scenario.
 
Shachar,

In addition to Stephany, think as well about a disconnected situation by
instance a pda.

There you have no alternative.

Cor
 
Usually when people say "this is the only right way" they mean "I only know
how to do it one way"...

That's my experience anyway..... and I agree with Stephany - it depends on
the scenario, the amount of data, the type of data, etc etc etc etc etc....

Try it both ways using the same data, and see for yourself the pros/cons of
each method. Also, when designing an app, think ahead to determine the
amount of data you may have to load into client memory if the database
suddenly expands by a decent amount. Your 4000 records today may be 250000
next month. Loading that all into client memory space could be fun.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top