Works seamlessly with SQL Server 2005 through 2014, making it a safe upgrade for mixed environments.

using System; using System.Data.SqlClient;

// Initialize the ODBC environment SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &sqlEnvHandle); SQLSetEnvAttr(sqlEnvHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, 0);