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 David.Mack@titan.com.

comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.