Beginning Asp.net 4.5 in Vb by Matthew MacDonald
Author:Matthew MacDonald [MacDonald, Matthew]
Language: eng
Format: epub
Tags: Computers, Programming Languages, Programming, Microsoft Programming, C#
ISBN: 9781430243298
Publisher: Apress
Published: 2012-09-26T04:00:00+00:00
In the rest of this chapter, you’ll consider how to write web page code that uses the classes in these namespaces. First you’ll consider the most straightforward approach—direct data access. Then you’ll consider disconnected data access, which allows you to retrieve data in the DataSet and cache it for longer periods of time. Both approaches complement each other, and in many web applications you’ll use a combination of the two.
Using Direct Data Access
The most straightforward way to interact with a database is to use direct data access. When you use direct data access, you’re in charge of building an SQL command (like the ones you considered earlier in this chapter) and executing it. You use commands to query, insert, update, and delete information.
When you query data with direct data access, you don’t keep a copy of the information in memory. Instead, you work with it for a brief period of time while the database connection is open, and then close the connection as soon as possible. This is different from disconnected data access, where you keep a copy of the data in the DataSet object so you can work with it after the database connection has been closed.
The direct data model is well suited to ASP.NET web pages, which don’t need to keep a copy of their data in memory for long periods of time. Remember, an ASP.NET web page is loaded when the page is requested and shut down as soon as the response is returned to the user. That means a page typically has a lifetime of only a few seconds (if that).
Note Although ASP.NET web pages don’t need to store data in memory for ordinary data management tasks, they just might use this technique to optimize performance. For example, you could get the product catalog from a database once, and keep that data in memory on the web server so you can reuse it when someone else requests the same page. This technique is called caching, and you’ll learn to use it in Chapter 23.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12570)
Hello! Python by Anthony Briggs(9914)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Dependency Injection in .NET by Mark Seemann(9337)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7066)
Microservices with Go by Alexander Shuiskov(6828)
Practical Design Patterns for Java Developers by Miroslav Wengner(6746)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6690)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Angular Projects - Third Edition by Aristeidis Bampakos(6094)
The Art of Crafting User Stories by The Art of Crafting User Stories(5619)
NetSuite for Consultants - Second Edition by Peter Ries(5558)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5363)
Kotlin in Action by Dmitry Jemerov(5062)
