In-Depth

Increased database performance

DataDirect''s Connect for .NET allows you to programmatically access the database entirely within the .NET Framework, to simplify database access and boost performance.

There are plenty of products on the market that enable you to manipulate databases programmatically. However, DataDirect's Connect for .NET sets itself apart because it enables you to access the database programmatically, entirely within the .NET Framework. This can be accomplished because the product is written completely in managed code. When you build applications that incorporate Connect for .NET, you can leverage the increased security and performance built into the .NET Framework.

The product's key features include support for Oracle, Sybase, DB2, and SQL Server databases; connection pooling; Microsoft Distributed Transaction Coordination (MS DTC); and existing stored procedures or text queries.

The installation for this product was easy and took roughly five minutes. The assemblies for the data providers are registered automatically in the Global Assembly Cache (GAC). If you decide to install and use MS DTC, the product warns you that it will require calling unmanaged code.

Using Connect for .NET also means you don't have to load the client libraries for each database you support. To start coding, I added a reference for the data provider I wanted to use in my C# VS.NET project and included the namespace in the appropriate source files (see Figure). At that point I was able to connect to the database and manipulate it easily with the ADO.NET accessor functions. As long as you don't change your connection string, you can take advantage of connection pooling. I had to be aware of the data types I retrieved and make sure they matched up with the corresponding type in the data provider. The documentation provides helpful database type/accessor mapping for each database.

When manipulating some of my test databases, I had to tweak some of the settings to get better performance. I increased the size of the connection pool as well as the connection timeout and saw a performance improvement. Some of my selection statements returned a large number of rows so I adjusted the Fetch Array Size attribute to further boost performance. The trace feature was helpful for debugging my stored procedures and text queries.

Although ADO.NET users should have no problem installing and using this product immediately, those unfamiliar with ADO.NET might want to study that technology first. It's a good fit for companies with a defined .NET strategy, because accessing databases through the .NET Framework provides increased security and performance. Developers will need a little time to become familiar with the type mapping between the database and data provider. The technical support on the Web site is good, as is the knowledgebase.

I would like to see actual source code examples shipped with the product so that a user can try it quickly without having to type code. This would require DataDirect to prepare an example for each database supported, but it would be helpful to the user. Developers who implement programs with native code can find cheaper solutions for their database connectivity, but it won't use the .NET Framework. If you're writing all managed code, you'll find this product a good addition to your toolbox for database access.

About the Author

David Mack is a technical lead and consultant for the National Intelligence Division at Titan Systems. He has more than 10 years of experience in management and software engineering. Reach him at [email protected].

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube