RepeatHost Business Hosting

odbc

Performance benchmarks for ODBC vs. Oracle, MySql, SQL Server .NET Providers

I did a simple benchmark for the 3 main databases (Oracle 11g, MySQL 5.1, SQL Server 2008) to see how using ODBC compares to using their native providers in .NET for all database access. To keep things on an even playing field, all 3 databases were run on the same machine, with the exact same database name, table name, and schema. Database authenticaton was used by all databases.

Get the list of ODBC data source names programatically using C#

Many times, you may need to get the list of currently set up ODBC data source names on the machine where your code is running from. There is no .NET API to get this list so you have to monkey with Windows registry a bit to find the list. There are 2 different types of ODBC data sources you can set up (User and System). The Data Source Names can be found in Windows by going to Administrative Tools->Data Sources(ODBC).

C# Store/Retrieve File in Database Image Field using ODBC

Sometimes you need to actually store a file in your database at the row level. There are a few pro's and con's to this.

Pros:

  • Easy backup of your database. If your application stores files and uses a database, this makes it easy for customers to back up everything without having to worry about both a database backup and file system backup. It also makes your back up (although very large) more portable because it can be a single file.
  • Leverage your database access code to manage files.