|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Loading controls with objects versus recordsetsdatabase. 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 mrmagoo wrote:
Show quoteHide quote > I'm building a vb.net Forms project that is getting data from a SQL Server You are not thinking about it correctly. if you are loading controls > 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 > > > 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'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. Show quoteHide quote "Chris" <no@spam.com> wrote in message news:ung2hd0aGHA.4060@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 mrmagoo wrote:
Show quoteHide quote > It's correct. It all depends on the size of your dataset and what the client computer > > 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:ung2hd0aGHA.4060@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 > > > specs would be. No general way is correct. Chris 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 Show quoteHide quote "mrmagoo" <-> schreef in bericht news:uLaBwT0aGHA.4116@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 > > > |
|||||||||||||||||||||||