Superior ADO.NET 1.1 Support

Advantage Database Server v8.1: A Developer’s Guide

by Cary Jensen and Loy Anderson

  © 2007 Cary Jensen and Loy Anderson. All rights reserved.

  Previous topic Next topic  

Whether you are a Visual Studio 2003 or Delphi for .NET developer, Advantage provides exceptional features in these IDEs and in the Advantage ADO.NET classes themselves. (Delphi for .NET is included in Delphi 8, Delphi 2005, Delphi 2006, and Turbo Delphi for .NET.)

As far as IDE support goes, if you choose to configure your data access at design time, Advantage gives you the automated tools you need to configure your components. When you drop an AdsDataAdapter onto a design surface, Advantage launches the Advantage Data Adapter Configuration Wizard (You can also manually invoke this wizard by right-clicking an AdsDataAdapter and selecting Configure Data Adapter). This wizard, shown in Figure 18-1, provides you with support for both building your connection string and creating the SQL statements that you associate with the data adapter's DeleteCommand, InsertCommand, SelectCommand, and UpdateCommand properties. In many cases, you only need to add the final code to open your AdsConnection and fill your datasets.

IMG00061

Figure 18-1 The Advantage Data Adapter Configuration Wizard

The AdsDataAdapter class also provides you with a special, integrated viewer that permits you to inspect your data directly within Delphi for .NET or Visual Studio. Simply right-click a configured AdsDataAdapter and select Preview Data to access this feature.

 
NOTE: While Microsoft's SQL Server .NET Data Provider provides help with building connection strings, it provides this feature using the Windows Data Link Properties dialog box. This dialog box works for the SqlConnection class because the SqlClient classes use COM interop to access SQL Server data using the Microsoft OLE DB Provider for SQL Server. The Advantage .NET Data Provider does not use COM interop to communicate with Advantage.
 

If instead of using design time configuration you choose to create and configure your data access components at runtime (which you will want to do if your applications need to be scalable), you can still use the code generated by the Advantage Data Adapter Configuration Wizard. Simply place an AdsDataAdapter into a form and use the wizard to configure the adapter and its AdsCommands. Then, copy the generated code and paste it into the appropriate location of your runtime code project.

While this wizard is impressive in its ease of use, it’s the Advantage Extended reader that we really love. This class, AdsExtendedReader, provides all of the basic functionality described by the IDataReader interface. But it does so much more.

While all data readers permit you to read data and navigate forward in a result set, the AdsExtendedReader adds support for server-side cursors. By leveraging the unique character of Advantage's architecture, the AdsExtendedReader provides you with read and write capabilities, bi-directional navigation; and server-side, optimized seeks, scopes, and filters. In our ASP.NET Web forms and Web services applications, we have found these capabilities to greatly simplify the process of working with data. We cannot imagine ADO.NET without the extended reader, but that is the world in which other .NET developers live.

Finally, Advantage includes the AdsHelper class, to provide convenient shortcuts to creating DataAdapters and DataTables. This class is available in both C# and VB for .NET source code that is installed in the Advantage .NET Data Provider installation directory.

C# and VB developers can add this source file directly to their projects, or they can compile a class library containing this class (which you then add to your References folder). Delphi for .NET developers can compile a class library containing this class using the C#Builder personality, and then access the AdsHelper class by adding a reference to this assembly to their project.

 
NOTE: For information on using the AdsHelper class, see the document AdsHelper.pdf, which is located in the installation directory of the Advantage Data Provider.