472,995 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,995 software developers and data experts.

Loading controls with objects versus recordsets

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
4 1469
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Darter Dan | last post by:
I've read that stored procedures should use output parameters instead of recordsets where possible for best efficiency. Unfortunately I need to quantify this with some hard data and I'm not sure...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
13
by: Simon Harvey | last post by:
Hi All, I have a colleague that I wprk with that develops using ASP. I develop using ASP.net. He seems to make sites much faster than me and I am wondering if its because of the two different...
7
by: Tim | last post by:
I am trying to load both server and user controls into placeholder controls on a aspx template page at runtime. These values would be strings that are returned from a database query. I know I can...
1
by: kanones | last post by:
Hi - I am seeing some performance degradation when I am loading a control dynamically onto a page with multiple other dynamical controls using Page.LoadControl versus dragging and dropping it...
0
by: Phl | last post by:
Hi, I am trying to create an webform which loads usercontrols dyanamically. I know exactly what to load for some of these controls but for some, I dont want to load it until the user has press a...
1
by: Bob Rock | last post by:
Hello, I'm new to ASP.NET and I've been looking into the topic of dynamically loading (typically accomplished with a LoadControl followed by a MyControl.Controls.Add()) both user controls and...
8
by: | last post by:
I'm looking for some design guidance on a collection of projects I'm working on. The project involves a bunch of websites constructed out of a collection of user controls. Different user...
2
by: adiel_g | last post by:
I added a user control to a webform in Asp.net 2.0. I am also adding several other user controls to this webform. Now I am trying to find a way to stop the user controls from loading up when I...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.