Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2006, 03:01 PM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Server vs Arrays

Newbie question. Why would I rely on Arrays and managing an array verses just getting the data from a database? Generally, I would be working on a box that would have a SQL db on it or on the same network. Would I be taking a significant performance hit not using Arrays?

Thanks

Bryan

 
Old August 14th, 2006, 06:55 PM
Authorized User
 
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Depends. if you plan on saving the data or running reports against the data then sql is best. Ifthe data is temporary then use arrays. There is a performance hit for going to SQL but it will not clock up your server's CPU cycles, just time it takes to log into SQL and time it takes for SQL to return the data you queried for. An array takes up memory on your app server but if you are just playing with the data temporarily and it isn't that much then arrays are good for performance. Use SQL only to storing data for later retrieval.

 
Old August 18th, 2006, 01:21 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not quite sure what comparison you are trying to make. In what situation would you trade off using an array versus a database?

On a potentially related note, ASP.NET 2.0 also has built-in features that provide for the caching of data from a database in web server memory, which can improve performance and reduce the number of requests the web server has to make to the database server for data.

You can also use datasets to make one initial call to the database, grab all of the data you want to work with in your application, then make all of the changes to the data in web server memory, then at the end of the session, push all of the changes back at once back to the database. I guess this is supposed to allow you to get more connections out of a single database server. I've not used this yet.

Neil Timmerman
Programmer II
School of Medicine
University of Missouri Columbia





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
Using Arrays in PL/SQL code_lover Oracle 2 March 17th, 2007 09:32 AM
How Can I Use Arrays with SQL Server Data? Lucy SQL Server ASP 4 June 14th, 2004 01:20 PM
Arrays In Sql alyeng2000 SQL Server 2000 3 June 1st, 2004 06:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.