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

  • Uno Platform Wants Microsoft to Improve .NET WebAssembly in Two Ways

    Uno Platform, a third-party dev tooling specialist that caters to .NET developers, published a report on the state of WebAssembly, addressing some shortcomings in the .NET implementation it would like to see Microsoft address.

  • Random Neighborhoods Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the random neighborhoods regression technique, where the goal is to predict a single numeric value. Compared to other ML regression techniques, advantages are that it can handle both large and small datasets, and the results are highly interpretable.

  • As Some Orgs Restrict DeepSeek AI Usage, Microsoft Offers Models and Dev Guidance

    While some organizations are restricting employee usage of the new open source DeepSeek AI from a Chinese company due to data collection concerns, Microsoft has taken a different approach.

  • Useful New-ish Features in .NET/C#

    We often hear about the big new features in .NET or C#, but what about all of those lesser known, but useful new features? How exactly do you use constructs like collection indices and ranges, date features, and pattern matching?

  • TypeScript 5.8 Beta Speeds Program Loads, Updates

    "TypeScript 5.8 introduces a number of optimizations that can both improve the time to build up a program, and also to update a program based on a file change in either --watch mode or editor scenarios."

Subscribe on YouTube