Sei sulla pagina 1di 9

Developer Center > ADO.NET Developer Center > ADO.NET Basics

Print

DataDirect Connect - ADO.Net Basics

What is the Microsoft .NET Architecture?


What is ADO.NET?
How Does ADO.NET Work?
Why Do Application Developers Need ADO.NET?
Why Should Application Developers Care about Managed Code?
What's the Difference Between DataDirect's Implementation of ADO.NET Data Provider
Technology vs. Competing Alternatives?
Which Version of the .NET Framework Does DataDirect Technologies Support?
ADO.NET Performance
ADO.NET Diagnostics
ADO.NET Security
Additional reasons to consider migrating to DataDirect's ADO.NET Data Providers for use with
your .NET Framework Application
Where Can I Learn More About ADO.NET and the .NET Framework?
24x7 Support

What is the Microsoft .NET Architecture?

The Microsoft .NET architecture is the programming model for the .NET platform. The .NET Framework
provides a managed execution environment, simplified development and deployment and integration with a
wide variety of programming languages.

The .NET Framework has two key parts:

The .NET Framework class library is a comprehensive, object-oriented collection of reusable types that you
can use to develop applications. The .NET Framework class library includes ADO.NET, ASP.NET, and
Windows Forms.

The common language runtime (CLR) is the core runtime engine for executing applications in the .NET
Framework. You can think of the CLR as a safe area - a "sandbox" - inside of which your .NET code runs.
Code that runs in the CLR is called managed code. It is fully protected from the outside environment and
highly optimized within, taking advantage of the services that the CLR provides such as security,
performance, deployment facilities, and memory management, including garbage collection.

What is ADO.NET?

ADO.NET is the data access component for the .NET Framework.

ADO.NET leverages the power of XML to provide disconnected access to data. ADO.NET is made of a set of
classes that are used for connecting to a database, providing access to relational data, XML, and application
data, and retrieving results. ADO.NET data providers contain classes that represent the provider's
Connection, Command, DataAdapter and DataReader objects (among others).

The following figure shows how ADO.NET fits into the communication between a Web client and the DBMS.
How Does ADO.NET Work?

ADO.NET makes it possible to establish a connection with a data source, send queries and update
statements to the data source, and process the results.

ADO.NET has several key components:

Application or component; processes and calls ADO.NET functions to submit SQL statements and retrieve
results.

DataSet; as in-memory cache of data which functions like a disconnected XML data cache. The overall
functions of the DataSet closely recall those of an in-memory database. The DataSet is designed to run in
the application space wherever the logic requires local data. This helps increase scalability of systems by
reducing load on the major database backends and enabling local processing of data across whatever tier
the application requires. For flexibility, the DataSet provides XML and relational interfaces of the data to the
developer.

DataReader; which provides a direct, read-only SQL interface to the backend. The DataReader is a
component of the data provider.

ADO.NET Data Provider; connects an ADO.NET application to the backend data store. The data provider
comprises the Connection, Command, DataReader and DataAdapter objects. The data provider supplies
connection information through the Connection object.

The following figure shows a scenario in which the application and the ADO.NET data provider are both built
with managed code. The application can connect to a database using either a DataSet and a DataAdapter or
using a DataReader.
Why Do Application Developers Need ADO.NET?

ADO.NET provides a comprehensive caching data model for marshalling data between applications and
services with facilities to optimistically update the original data sources. This enables developer to begin with
XML while leveraging existing skills with SQL and the relational model.

Although the ADO.NET model is different from the existing ADO model, the same basic concepts include
provider, connection and command objects. By combining the continued use of SQL with similar basic
concepts, current ADO developers should be able to migrate to ADO.NET over a reasonable period of time.

Why Should Application Developers Care about Managed Code?

Code that runs within the CLR is called managed code. Code that runs in the native OS and not the CLR,
such as client libraries, COM components, etc. is called unmanaged code. You can mix managed and
unmanaged code within a single application.

Unlike 100% managed code, unmanaged code reaches outside the CLR, increasing complexity, reducing
performance and opening potential security risks. While some vendors promote their .NET data providers as
"built with managed code", they do not promote the fact that the data provider must call to the client
libraries to make a connection to the database, introducing unmanaged code.

The following figure shows the difference between using a managed data provider that calls the client library
and using a Wire Protocol managed data provider that connects to the DBMS with no intervening
unmanaged code.
DataDirect Connect for .NET data provider uses Wire Protocol technology, eliminating the need to call
client libraries, simplifying development and dramatically reducing configuration and support issues.

The built-in advantages of Wire Protocol technology gives DataDirect Technologies ADO.NET data providers
a big advance over competing data providers. DataDirect ADO.NET data providers are built from 100%
managed code.

To learn more about the importance of managed code, visit this link.

What's the Difference Between DataDirect's Implementation of ADO.NET Data Provider


Technology vs. Competing Alternatives?

View a competitive matrix chart for Sybase.

View a competitive matrix chart for DB2.

View a competitive matrix chart for Oracle.

DataDirect ADO.NET data providers offer the following advantages over other ADO.NET data
providers:

DataDirect Technologies offers the only 100% managed code ADO.NET data providers for all major
databases, including:
 Oracle  DB2
 Microsoft SQL Server  Sybase

By using 100% managed code, you can take advantage of the numerous built-in services of the CLR,
enhancing the performance of your managed application. In addition, because no calls are made outside of
the .NET Framework, you get automatic memory management and built-in security checks

DataDirect works closely with Oracle, IBM, Microsoft, Sybase, and other database vendors. This allows
DataDirect to gain early access to new database versions and insight into product and architectural
direction.

DataDirect Connect for .NET is tested against Microsoft's proprietary ADO.NET test suites. To supplement
that testing and further ensure the quality of our data providers, we have developed our own extensive test
suite.

DataDirect data providers support interoperability features, including:

 Escape syntax for stored procedure executions


 Scalar functions
 Outer joins

Which Version of the .NET Framework Does DataDirect Technologies Support?

DataDirect Connect for .NET 2.2 data providers support versions 1.0 and 1.1 of the .NET Framework. You can
download all supported versions of the Microsoft .NET Framework from the Microsoft web site. You can also
download the .NET Redistributable, which provides the software that you and your customers need to run
.NET Framework applications.

DataDirect Connect for .NET 2.2 has been certified for running on the .NET Framework 2.0. Any applications
built with Visual Studio .NET 2005 (using the .NET Framework 1.x functionality and ADO.NET 1.0 interfaces)
are now supported.

DataDirect Technologies will fully support ADO.NET 2.0 functionality in the Microsoft .NET Framework 2.0 in
an upcoming release.

ADO.NET Performance

The CLR was designed from the start to provide optimized performance. By using 100% managed code, you
can take advantage of the numerous built-in services of the CLR to enhance the performance of your
managed application.

Because of the runtime services and checks that the CLR performs, applications do not need to include
separate versions of these services.

Performance and scalability may be impacted by many different factors, from application architecture to
tuning options to the software itself. Using 100% managed code eliminates the need to call COM
components. In managed code, all the data, logic and processing reside within the CLR. 100% managed
code eliminates dependencies on native vendor code.
Applications built from managed code can call COM components and other unmanaged code. However, the
cost can become very expensive because of extra security checks.

To learn more about optimizing DataDirect's ADO.NET data providers for high performance data
connectivity, visit this page.

ADO.NET Diagnostics

The .NET Trace class provides a set of methods and properties that help you trace the execution of your
code. You can use the properties and methods in the Trace class to instrument release builds.

Instrumentation allows you to monitor the health of your application running in real-life settings. Tracing
helps you isolate problems and fix them without disturbing a running system.

In Visual Studio .NET projects, the Trace class is enabled by default. This means that code is generated for
all Trace methods in both release and debug builds. End users can turn on tracing to help identify the
problem without the program having to be recompiled.

The .NET Framework 2.0 includes Tracing support for the Microsoft ADO.NET data providers for fine-grained
debugging of data access components across multiple tiers and into .NET Framework managed code, as well
as native code.

DataDirect Technologies ADO.NET data providers have always supported tracing. Each of our data providers
can trace the input arguments to all of its public method calls, as well as the outputs and returns from those
methods (anything that a user could potentially call). The DataDirect ADO.NET data providers deliver
additional tracing capability, including tracing input arguments to all public method calls and tracing outputs
and returns from those methods (anything that a user could potentially call). Each call contains trace entries
for entering and exiting the method. Provider-specific methods allow the data providers to trace all method
calls to a user-specified trace file.

The DataDirect ADO.NET data providers contain PerfMon hooks that let you monitor the number of
connections, connection pools and the number of connections in connection pools.

Data Connectivity Security with ADO.NET

Microsoft devoted significant effort toward addressing security in regard to ADO.NET and the CLR itself,
providing tremendous advances for the platform. Code access security (an important feature of the .NET
Framework) helps to limit access to protected resources.

Systems administrators can define a security policy that very precisely identifies which functions users or
assemblies will be allowed to access. By contrast, an application that includes unmanaged code cannot take
advantage of these security capabilities.

Microsoft's MSDN document, "Secure Coding Guidelines for the .NET Framework", states;

"Some library code may need to call into unmanaged code. Because this requires going outside the security
perimeter for managed code, due caution is required... because any managed code that affords a code path
into native code is a potential target for malicious code. Determining which unmanaged code can be safely
used and how it must be used requires extreme care."
With managed code, the application does not have direct access to pointers, machine registers or memory.
100% managed code is fully controlled by security policies within the .NET Framework. The .NET Framework
enforces security by causing potentially dangerous actions to fail with a security violation exception. Buffer
overruns, which are a common type of security hole, are virtually impossible with 100% managed code.

Additional reasons to consider migrating to DataDirect's ADO.NET Data Providers for use
with your .NET Framework Applications

DataDirect Technologies has enjoyed a long-standing strategic technology relationship with Microsoft. We
continue to collaborate with Microsoft on the development of the ADO.NET specification, extending and
improving the standard for all major databases. The result of this relationship is DataDirect Connect for
.NET, the only business class suite of data providers built with 100% managed code.

In addition, DataDirect Connect for .NET provides:


- Only suite of .NET data providers to offer SQL leveling functionality, delivering easier portability between
databases, simplified testing, and fewer lines of code to maintain.
- Quality assured by rigorous product testing and use of both the Microsoft test suite and DataDirect's own
large test suite.

DataDirect Connect for .NET - Oracle

Fully supports all Oracle systems including Oracle 8.1.6, 8.1.7, 9iR1, 9iR2, 10g R1, and 10g R2 from a
single data provider assembly that is 100% managed .NET code.
Eliminates the requirement for Oracle networking software (Oracle*NET)
Supports provider interoperability features such as escape syntax for stored procedure executions,
scalar functions and literal values. Additionally, supports provider ANSI standard parameter markers,
neutral error objects, standardized error code mappings and common ways to specify arrays of
parameters for use.
Fully supports stored procedures that choose to return results in PL/SQL TABLE type output parameters.
Supports the ability to execute a single SQL statement using multiple rows of values.
Tuning options to control the amount of data that is returned across the network on single roundtrips
from the Oracle server.
Highly optimized for queries that return multiple results. For applications that return more than 2 or 3
rows from a single query, DataDirect's Connect for .NET Oracle data provider has performance
advantages of up to 50-150% over all competitive providers in benchmarks run inside the DataDirect
labs.

To learn more about DataDirect Connect for .NET for Oracle databases, visit this page.

DataDirect Connect for .NET - DB2

Supports interoperability features such as escape syntax for stored procedure executions, scalar
functions, and outer joins. Additionally, supports provider-neutral error objects, standardized error code
mappings and common methods to specify arrays of parameters for use.
Fully supports all DB2 systems including DB2 UDB V7.x and v8.x on Linux, UNIX, and Windows, DB2
v7.x, 8.1 for z/OS via DRDA and DB2 UDB V5R1, V5R2, and V5R3 for iSeries from a single data
provider assembly that is 100% pure managed .NET code.
Eliminates the requirement for the DB2 client software (DB2 CAE)
Supports the ability to execute a single SQL statement using multiple rows of values.
Highly optimized for queries that return multiple results. For applications that return 10 rows from a
single query, the DataDirect DB2 data provider has performance advantages of up to 30-40% over
IBM's data providers in benchmarks run inside the DataDirect labs. This performance advantage
increases to upwards of over 100% when the number of results exceeds 50 result rows.

To learn more about DataDirect Connect for .NET for DB2 databases, visit this page.

DataDirect Connect for .NET - Sybase

Fully supports Sybase Adaptive Server 11.5 and 11.9, and Sybase Adaptive Server Enterprise 12.0,
12.5, 12.5.1, 12.5.2, and 12.5.3 systems from a single provider assembly that is 100% pure
managed .NET code.
Eliminates the requirement for any Sybase client software (Open Client)
Supports provider interoperability features such as escape syntax for stored procedure executions,
scalar functions, and literal values. Additionally, the DataDirect ADO.NET data provider supports
provider-neutral error objects, standardized error code mappings and common ways to specify arrays of
parameters for use.
Supports the ability to execute a single SQL statement using multiple rows of values through the use of
parameter arrays.
Highly optimized for queries that return multiple results. For applications that return more than 2 or 3
rows from a single query, the DataDirect ADO.NET data provider has performance advantages of up to
50-150% over all competitive data providers in benchmarks run inside the DataDirect labs.

To learn more about DataDirect Connect for .NET for Sybase databases, visit this page.

DataDirect Connect for .NET - SQL Server

Fully supports Microsoft SQL Server systems including Microsoft SQL Server 7, SQL Server 2000
(including service packs 1, 2, 3, and 3a), SQL Server 2000 Desktop Engine, SQL Server Enterprise
Edition (64-bit) and SQL Server 2005 (with DataDirect Connect for .NET 2.2 Patch 2.2.0016 or later),
from a single provider assembly that is 100% pure managed .NET code.
No need for MDAC or any other external software to be installed
Supports provider interoperability features such as escape syntax for stored procedure executions,
scalar functions and literal values. Additionally, the DataDirect data provider supports provider-neutral
error objects, standardized error code mappings and common ways to specify arrays of parameters for
use.
Supports the ability to execute a single SQL statement using multiple rows of values through the use of
parameter arrays.

Where Can I Learn More About ADO.NET and the .NET Framework?

To learn more about DataDirect Connect for .NET, visit this page.
To learn more about the .NET framework, visit this page.
For information about the .NET Framework as well as downloads, see the MSDN Library.
For information on how different companies are using the .NET Framework, see the Microsoft Case
Studies page.
For information about how to perform common tasks, including data access tasks such as using
database transactions and connection pooling, see the Common Tasks Quick Start.
To see an example of a Web service implemented with .NET, see the TerraServer USA page, which
exposes map and aerial photograph information, courtesy of the Microsoft TerraService project. The
TerraServer USA project exposed additional information such as schools and homes for sale in the area
of a selected photograph; however, many of those links are no longer maintained.
Read "Microsoft ADO.NET" by Dave Sceppa.

Potrebbero piacerti anche