By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,915 Members | 1,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,915 IT Pros & Developers. It's quick & easy.

Loading controls with objects versus recordsets

P: n/a
I'm building a vb.net Forms project that is getting data from a SQL Server
database.

One of the main goals of the project is to be really responsive to events,
such as textbox change events. I have a textbox for searching, a listbox to
display the searched results, and a big textbox (memo) to display the
clicked-results of the listbox item.

My question is: should I load the controls with objects, and therefore store
everything in memory for fast performance, or is SQL Server fast enough to
capture textbox_change events and return recordsets? Or am I asking too much
of SQL Server? Locally, there will be a dedicated MSDE database, so the load
is manageable. The main database is a shared SQL Server db which is
synchronized as needed.

I have had great results loading controls with objects...the performance is
incredible. However, I think that in the future, as the dataset grows, I
might be storing a couple of megs in RAM, so there might be a penalty in the
future. If I use recordsets, I immediately get a performance penalty, but I
have unlimited future growth.

I appreciate any feedback from anyone on this...what your preferences are
and why. thanks

Apr 29 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
mrmagoo wrote:
I'm building a vb.net Forms project that is getting data from a SQL Server
database.

One of the main goals of the project is to be really responsive to events,
such as textbox change events. I have a textbox for searching, a listbox to
display the searched results, and a big textbox (memo) to display the
clicked-results of the listbox item.

My question is: should I load the controls with objects, and therefore store
everything in memory for fast performance, or is SQL Server fast enough to
capture textbox_change events and return recordsets? Or am I asking too much
of SQL Server? Locally, there will be a dedicated MSDE database, so the load
is manageable. The main database is a shared SQL Server db which is
synchronized as needed.

I have had great results loading controls with objects...the performance is
incredible. However, I think that in the future, as the dataset grows, I
might be storing a couple of megs in RAM, so there might be a penalty in the
future. If I use recordsets, I immediately get a performance penalty, but I
have unlimited future growth.

I appreciate any feedback from anyone on this...what your preferences are
and why. thanks


You are not thinking about it correctly. if you are loading controls
from objects or directly from SQL the data still has to come from SQL at
some point. Now if you are talking about bringing all the data down and
storing it locally, that will always be fastest.

Chris
Apr 29 '06 #2

P: n/a
It's correct.

Depending on the design, there are 2 general possibilities. (or more if you
can think of a better way).

If this is an object based approach, launching the application returns a
recordset and loads all of that into memory. From that point on, the events
load controls from memory.

If this is all recordsets, launching the application does nothing. Typing in
the controls returns small recordsets of matched results for each keystroke.

Does that make sense? At some intervals there will always be recordsets. For
the memory based approach, it occurs on app launch and other intervals as
needed. Perhaps there will be a "refresh" command button that will re-load
all of the objects from the same event that loaded the recordset on app
launch.

For the recordset approach recordsets occur a lot more frequently.
"Chris" <no@spam.com> wrote in message
news:un**************@TK2MSFTNGP02.phx.gbl...
mrmagoo wrote:
I'm building a vb.net Forms project that is getting data from a SQL Server database.

One of the main goals of the project is to be really responsive to events, such as textbox change events. I have a textbox for searching, a listbox to display the searched results, and a big textbox (memo) to display the
clicked-results of the listbox item.

My question is: should I load the controls with objects, and therefore store everything in memory for fast performance, or is SQL Server fast enough to capture textbox_change events and return recordsets? Or am I asking too much of SQL Server? Locally, there will be a dedicated MSDE database, so the load is manageable. The main database is a shared SQL Server db which is
synchronized as needed.

I have had great results loading controls with objects...the performance is incredible. However, I think that in the future, as the dataset grows, I
might be storing a couple of megs in RAM, so there might be a penalty in the future. If I use recordsets, I immediately get a performance penalty, but I have unlimited future growth.

I appreciate any feedback from anyone on this...what your preferences are and why. thanks


You are not thinking about it correctly. if you are loading controls
from objects or directly from SQL the data still has to come from SQL at
some point. Now if you are talking about bringing all the data down and
storing it locally, that will always be fastest.

Chris

Apr 29 '06 #3

P: n/a
mrmagoo wrote:
It's correct.

Depending on the design, there are 2 general possibilities. (or more if you
can think of a better way).

If this is an object based approach, launching the application returns a
recordset and loads all of that into memory. From that point on, the events
load controls from memory.

If this is all recordsets, launching the application does nothing. Typing in
the controls returns small recordsets of matched results for each keystroke.

Does that make sense? At some intervals there will always be recordsets. For
the memory based approach, it occurs on app launch and other intervals as
needed. Perhaps there will be a "refresh" command button that will re-load
all of the objects from the same event that loaded the recordset on app
launch.

For the recordset approach recordsets occur a lot more frequently.
"Chris" <no@spam.com> wrote in message
news:un**************@TK2MSFTNGP02.phx.gbl...
mrmagoo wrote:
I'm building a vb.net Forms project that is getting data from a SQL
Server
database.

One of the main goals of the project is to be really responsive to
events,
such as textbox change events. I have a textbox for searching, a listbox
to
display the searched results, and a big textbox (memo) to display the
clicked-results of the listbox item.

My question is: should I load the controls with objects, and therefore
store
everything in memory for fast performance, or is SQL Server fast enough
to
capture textbox_change events and return recordsets? Or am I asking too
much
of SQL Server? Locally, there will be a dedicated MSDE database, so the
load
is manageable. The main database is a shared SQL Server db which is
synchronized as needed.

I have had great results loading controls with objects...the performance
is
incredible. However, I think that in the future, as the dataset grows, I
might be storing a couple of megs in RAM, so there might be a penalty in
the
future. If I use recordsets, I immediately get a performance penalty,
but I
have unlimited future growth.

I appreciate any feedback from anyone on this...what your preferences
are
and why. thanks


You are not thinking about it correctly. if you are loading controls
from objects or directly from SQL the data still has to come from SQL at
some point. Now if you are talking about bringing all the data down and
storing it locally, that will always be fastest.

Chris



It all depends on the size of your dataset and what the client computer
specs would be. No general way is correct.

Chris
Apr 29 '06 #4

P: n/a
Mr Magoo,

It depends all from the style from your query box and the ammount of data.

Probably a recordset will not help you much to get speed, because the
datatable is much faster to retrieve and to access. Your program will as
well be needless large because the extra memory you will have to use to hold
the ADODB DLL.

I would just start with creating a query for SQL and return the answer with
an executeScalar.

Just my thought,

Cor

"mrmagoo" <-> schreef in bericht
news:uL**************@TK2MSFTNGP05.phx.gbl...
I'm building a vb.net Forms project that is getting data from a SQL Server
database.

One of the main goals of the project is to be really responsive to events,
such as textbox change events. I have a textbox for searching, a listbox
to
display the searched results, and a big textbox (memo) to display the
clicked-results of the listbox item.

My question is: should I load the controls with objects, and therefore
store
everything in memory for fast performance, or is SQL Server fast enough to
capture textbox_change events and return recordsets? Or am I asking too
much
of SQL Server? Locally, there will be a dedicated MSDE database, so the
load
is manageable. The main database is a shared SQL Server db which is
synchronized as needed.

I have had great results loading controls with objects...the performance
is
incredible. However, I think that in the future, as the dataset grows, I
might be storing a couple of megs in RAM, so there might be a penalty in
the
future. If I use recordsets, I immediately get a performance penalty, but
I
have unlimited future growth.

I appreciate any feedback from anyone on this...what your preferences are
and why. thanks

Apr 29 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.