Catálogo de publicaciones - libros

Compartir en
redes sociales


Pro ADO.NET 2.0

Sahil Malik;

Disponibilidad

Institución detectada Año de publicación Navegá Descargá Solicitá
No detectada 2005 SpringerLink

Tabla de contenidos

An Introduction to ADO.NET

Sahil Malik

This chapter gave a brief introduction to the exciting world of ADO.NET. It introduced you to various important classes and their logical groupings within ADO.NET.

It touched upon the need for a new data access architecture and the problems it solves. It also showed how ADO.NET is logically grouped in the connected and disconnected parts and how various data sources are supported using the ProviderBase model. It outlined the challenges you can face when working with different providers available in ADO.NET as well as the various facilities ADO.NET provides to create a data source-agnostic data layer.

In the next chapter, you will build upon what you have already learned in this chapter and logically group the various classes into the namespace architecture that ADO.NET provides.

Pp. 1-14

The ADO.NET Object Model

Sahil Malik

his chapter will walk you through the installation process for ALSB and the process of configuring your development environment. By the end of this chapter, you’ll be able to compile and run the sample code that comes with this book.

Pp. 15-30

ADO.NET Hello World!

Sahil Malik

Chapter 1 began by giving you a very high 30,000-ft. overview of what ADO.NET is, and where it fits into your general application architecture.

Chapter 2 got a little bit closer to the ground and took the discussion away from logical block diagrams and more toward class diagrams and the physical class structure layout of the various major objects and namespaces involved in ADO.NET. At this point, you should quickly glance back at Chapter 2 and compare the SqlConnection and SqlCommand objects involved in the last presented example in that chapter.

Chapter 3 was the first chapter in this book that presented you with true hands-on code, and you created four working data-driven applications.

So now that you have actually started walking on the ground of this new planet and have actually built some data-driven applications, it’s time to start running by digging deeper into the framework. As an application architect and programmer, it’s not only important to understand how to do something, but it’s also important to understand how to do it right, and be able to reason between the various ways to achieve the same goal.

I can’t tell you the one possible panacea simply because there isn’t one that fits every single situation out there. This is because application architecture, especially ADO.NET, can’t be zeroed down to black or white. There are too many scenarios to deal with and various shades of gray involved. However, certain things, such as not closing your database connections or abusing a DataSet as a database, are clearly bad.

Starting with Chapter 4, you’ll see the various important objects involved in ADO.NET and the usage scenarios and best practices involved with them. As the book carries forward, the discussion will continue to visit various other important objects, their usage scenarios, and best practices involved.

Now that you have landed on this planet and have walked around a bit, tighten your seat belts, pack your bags, and hold onto your seat tightly, your magic carpet ride is about to begin with Chapter 4, “Connecting to a Data Source.”

Pp. 31-52

Connecting to a Data Source

Sahil Malik

In this chapter, you examined the various facets involved in being able to connect to a database through ADO.NET. You examined the class structure and learned how to establish a simple connection by specifying a connection string. Because it could be difficult to remember all those parameter name keywords, you looked at two alternate mechanisms for easily coming up with connection strings and a standard way of securing connection strings. Finally, you learned about connecting to the database in high-demand applications using connection pools. You saw an example of how using a connection pool could vastly affect application performance and what was necessary to do in applications to take advantage of connection pools.

Now that you know how to connect to a data source, in the next chapter you’ll learn about how to execute commands and retrieve data from the data source in a connected mode.

Next, you’ll look at data readers and commands in ADO.NET.

Pp. 53-75

Retrieving Data in a Connected Fashion

Sahil Malik

In this chapter you examined retrieving data from a data source in a connected fashion using ADO.NET. You saw the DbCommand object, provided to you by ADO.NET, enable encapsulation of a text-based command and the various methods it provides you to access your data in a connected fashion. (One detail that was not covered in this chapter was the ExecuteXmlReader method on the SqlCommand object, which will be covered in depth in Chapter 12.) Finally you saw a new feature that SQL Server 2005 supports: storing objects directly into the database using UDTs.

Also in this chapter, one of the examples you saw concerned itself with creating a disconnected cache of your data using the data reader object. Even though a data reader is constantly connected to the database, we saw an example of where it would indeed make sense to be able to create such a disconnected cache of your data for further processing. In that example, you had to cook up your own solution to meet the desire for a disconnected paradigm of data. However, ADO.NET comes with a rich inbuilt collection of classes for this very purpose. This aspect of ADO.NET is examined in depth in the next chapter.

Pp. 77-107

DataSets

Sahil Malik

his chapter will walk you through the installation process for ALSB and the process of configuring your development environment. By the end of this chapter, you’ll be able to compile and run the sample code that comes with this book.

Pp. 109-175

Fetching Data: The DataAdapter

Sahil Malik

This chapter introduced you to the bridge between the connected and disconnected worlds within ADO.NET-the DataAdapter object. Just as Chapter 5 was concerned with fetching data in a connected mode, this chapter used DbCommand objects specified to the DataAdapter object to fill DataTables and DataSets.

You saw the various ways to fill either a DataSet or a DataTable. You also saw the importance of a schema present in a DataSet. You saw how the presence of a schema in a DataSet helps the DataAdapter make correct decisions when filling the data.

Finally, you saw how to use mapping to make code easier to read and modify, and how to map column and table names so that data can be passed easily between different data sources.

You saw how to use the AS keyword in SQL, which is a simple but inflexible way to achieve column mappings and really doesn’t help you do table mappings, after which the ADO.NET mapping objects were discussed. The DataAdapter object’s ColumnMappings property and the DataColumnMapping and DataTableMapping classes were demonstrated with a couple of examples.

Now that you have seen the objects required to hold disconnected data and how to fill data in those objects, the next chapter covers being able to work with the disconnected data objects once you have filled them from the data source. Our discussion will move to sorting, searching, and filtering disconnected data per your application’s logic and requirements.

Pp. 177-212

Sorting, Searching, and Filtering

Sahil Malik

In this chapter, you looked at sorting, searching, and filtering over disconnected data. This is quite an important part of ADO.NET. A good handle on these concepts will allow you to write effective applications.

This chapter discussed the various methods of working with disconnected data using DataTables, DataViews, DataRelations, and, finally, using the XmlDataDocument. Typically, in an application built around disconnected architecture, you would query the data and fill a disconnected cache-such as a DataTable or a DataSet. Then, based upon the user’s requests, you would make updates to that data.

While this chapter presented you with the concepts of being able to find the right rows to make updates to, the next two chapters will discuss the process of making the updates and persisting them into a data source. What you have learned in this chapter will be very useful in the next chapter, which discusses updating data.

Pp. 213-245

Updating Data

Sahil Malik

his chapter will walk you through the installation process for ALSB and the process of configuring your development environment. By the end of this chapter, you’ll be able to compile and run the sample code that comes with this book.

Pp. 247-319

Updating Data: Advanced Scenarios

Sahil Malik

his chapter will walk you through the installation process for ALSB and the process of configuring your development environment. By the end of this chapter, you’ll be able to compile and run the sample code that comes with this book.

Pp. 321-353

Transactions

Sahil Malik

his chapter will walk you through the installation process for ALSB and the process of configuring your development environment. By the end of this chapter, you’ll be able to compile and run the sample code that comes with this book.

Pp. 355-411

XML and ADO.NET

Sahil Malik

his chapter will walk you through the installation process for ALSB and the process of configuring your development environment. By the end of this chapter, you’ll be able to compile and run the sample code that comes with this book.

Pp. 413-460

The CLR in SQL Server

Sahil Malik

This chapter introduced you to a powerful new technology, SQLCLR, that opens many new doors for the architect in you.

You saw how the CLR running inside the SQL Server behaves differently from the CLR you see running on any Windows machine. You saw how it puts security requirements on your code, and how you need to explicitly decide the specific functionality your SQLCLR code will require. You saw how SQLCLR code can be written either as a SQL Server project or as a simple class library. You also saw how to write common SQLCLR objects such as UDFs, TVFs, aggregates, stored procedures, and triggers and how to debug such code.

It’s true that SQLCLR gives you a lot of freedom, but with freedom comes responsibility. Like anything, it’s very tempting and easy to abuse or misuse SQLCLR for purposes it isn’t well suited for.

In the next and very last chapter of this book, I will discuss some of the biggest debates that surround ADO.NET. I will try and address best practices that will help you reason the correct decision in the specific circumstances.

In addition to other topics, the correct and proper use of SQLCLR will be touched upon. It’s extremely important to learn the responsibilities from the next chapter along with the possibilities that you learned in this chapter.

See you in the next and very last chapter, “ADO.NET Best Practices.”

Pp. 461-511

ADO.NET Best Practices

Sahil Malik

his chapter will walk you through the installation process for ALSB and the process of configuring your development environment. By the end of this chapter, you’ll be able to compile and run the sample code that comes with this book.

Pp. 513-527

Información

Tipo: libros

ISBN impreso

978-1-59059-512-1

ISBN electrónico

978-1-4302-0068-0

Editor responsable

Springer Nature

País de edición

Reino Unido

Fecha de publicación