Database question

  • Thread starter Thread starter glenn
  • Start date Start date
G

glenn

If I setup a connection and the appropriate items in C# to link a queried
dataset that comes back with 100,000 results to a grid component on a
windows form, does that mean that my program just read 100,000 records over
the network at once? Or does the grid and dataset have built in knowledge
that allows them to retrieve a select few of the records and then retrieves
more as I scroll up and down through the grid?

Thanks,

glenn
 
glenn said:
If I setup a connection and the appropriate items in C# to link a queried
dataset that comes back with 100,000 results to a grid component on a
windows form, does that mean that my program just read 100,000 records over
the network at once? Or does the grid and dataset have built in knowledge
that allows them to retrieve a select few of the records and then retrieves
more as I scroll up and down through the grid?

Thanks,

glenn

considering the fact that the dataset is part of the
disconnected ado.net model, i would assume that all records
where transmitted over the network.

i would, however, reconsider my design strategies if my
application receives 100,000 results. what could possibly be
the reason for retrieving 100,000 records from a database
besides exporting them to a file?

is there no way you can reduce the number of records being
retrieved?

evert.
 
Well, let me explain:

1) Drop down lists that allow you to start typing a customer's phone and it
matches customers as you type. This is a feature easily accomplished in
Delphi as it only read over necessary records to keep things appearing as if
the drop down had 50,000 records in it, but in reality it was only bringing
over enough records to keep the 10 height of the drop down filled with
records.

2) Parts lists. We have a business application that will typically have
over 1 million records in the parts list. Our customers love our current
version of the application because they can scroll up and down in the parts
grid and look for things visually without having to do hundreds of searches
to try to find things. They also can start typing in a part number and the
system will immediately begin narrowing the view of the grid with numbers
that match their entry.

This is all accomplished without much data moving over the wire at all,
because Delphi allows you to read over only enough records to fill the grid.
Its also extremely fast as you can imagine.

This is a feature that allows you to accomplish things that customers love.
From what I'm seeing trying to accomplish such a task in C# and VS 2003 is
next to impossible but I wanted to be sure I understood what was going on as
no Book I've read so far has even bothered to mention how it was handling
things such as this.

A disconnected model works well for Internet applications but its my opinion
that its pretty slack for trying to provide customers with the types of
applications they require. I love C# but am constantly amazed at how
Microsoft could hire Borlands top developers from out from under them and
this is what they would design.

glenn
 
Well said glenn,

I thought i am only person who thinks outside the box[.Net].
I know there are lot of people here reading this reply but cannot reply as
they don't have answer or they think this is stupid. Let me tell you
something, as you mentioned, Delphi supports loading data as you scroll "I
love that stuff" and Microsoft will never be able to do that rather tell you
that you stupid to download such large dataset and always want
developers/users to do things their way. I dont know how Borland does that
but if they can do I think anyone can do[Microsoft???].

we as developers need to display data to the user and make programs the way
they like. We should have the way to do things the way we[they] like, i know
its not good thing to download 100,000 but if I really have to then i should
be able to do that and .Net should support that.

Anyway, I am a Delphi and now C# developer even though i hate the fact that
i cannot do things the way Delphi does we still have to deal with it. I like
CSharp for its ease of coding but i still wish to see lot of improvements in
..Net.

Arun
 
What a shock. I can't believe I've found someone to side with me on Delphi
on this forum... :-)

Thanks for the support, but keep in mind that while Microsoft may say its
stupid to read over 100,000 records, that is not at all what we're doing.
We're only reading over records as the user needs more to fill the grid. So
while there may be a million records in the table, we probably on a typical
session would only ready 50 records across to supply what they are looking
at.

Granted if they held down the down arrow key and scrolled through all 1
million then it would eventually download all million, but that would be the
only time that would happen and who would want to sit that long holding a
key?

Thanks,

glenn
 
It's possible that Borland has a patent on the way they do this and MS can't
violate their patent.

I seem to remember reading a description of how to do this in Sceppa's ADO.NET
book.
Well, let me explain:

1) Drop down lists that allow you to start typing a customer's phone and it
matches customers as you type. This is a feature easily accomplished in
Delphi as it only read over necessary records to keep things appearing as if
the drop down had 50,000 records in it, but in reality it was only bringing
over enough records to keep the 10 height of the drop down filled with
records.

2) Parts lists. We have a business application that will typically have
over 1 million records in the parts list. Our customers love our current
version of the application because they can scroll up and down in the parts
grid and look for things visually without having to do hundreds of searches
to try to find things. They also can start typing in a part number and the
system will immediately begin narrowing the view of the grid with numbers
that match their entry.

This is all accomplished without much data moving over the wire at all,
because Delphi allows you to read over only enough records to fill the grid.
Its also extremely fast as you can imagine.

This is a feature that allows you to accomplish things that customers love.
From what I'm seeing trying to accomplish such a task in C# and VS 2003 is
next to impossible but I wanted to be sure I understood what was going on as
no Book I've read so far has even bothered to mention how it was handling
things such as this.

A disconnected model works well for Internet applications but its my opinion
that its pretty slack for trying to provide customers with the types of
applications they require. I love C# but am constantly amazed at how
Microsoft could hire Borlands top developers from out from under them and
this is what they would design.

glenn

Otis Mukinfus
http://www.otismukinfus.com
 
Oh, news to me that MS won't violate others patent. I hear database paging
method is implemented in .Net 2.0.
 
There is no patent here I do not believe. I think Microsoft is so focused
on disconnected architectures that it just hasn't thought about anything
like this. There are a lot of signs of non thinking in VS 2003 compared to
Delphi. Hopefully 2005 VS will fix them though...

glenn


 
Hi,
I have experienced the same performance issues with a listbox connected
to a dataset cotaining a couple of thousands of records. I was thinking
about loading only let's say 40-50 records at the beginning (calling the
Fill() function with number of records as parameter), this would allow
the user to see almost imediately something on the screen. After that I
would start a thread that continues filling the dataset in background.
Is this possible to be impemented in .NET ? Do I have any
restrictions/conflicts at accessing from another thread the dataset
connected to a listbox in a Windows.Form, created in the main() function
? I would put the code of the thread in the same namespace as the main
form, to be able to access all necessary variables. Is this technically
possible ? Or is there some better way to solve this performance problem
(I mean with C# of course, other languages are not a issue for me).
Thanks in advance,
Abra
 
Actually yes, you could experience a problem trying to do it this way. A
better approach would be to handle it like Delphi does. As you reach the
end of the current record set, it goes out and grabs another 10 or 20
records to continue scrolling through. If the user begins to type, it will
retrieve records to match what they had typed so far so that the list is
always full but never has more than a few records in it at any one time.

What VS is doing is useless in my opinion and takes me back to the 1990's.
I can't believe that they did not spend more time thinking this sort of
thing out. This one thing is going to cause me to have to abandon VS
altogether if I can't find some way to work through it.

Good luck,

glenn
 
Back
Top