示例#1
0
 internal static extern OdbcReturnCode SQLSetEnvAttr(OdbcEnvironmentHandle environmentHandle, OdbcEnvironmentAttribute attribute, int value, int valueLengthShouldBeZero);
示例#2
0
        internal static void SetIntEnvironmentAttribute(OdbcEnvironmentHandle environmentHandle, OdbcEnvironmentAttribute attribute, int value)
        {
            if (environmentHandle == null) throw new ArgumentNullException("environmentHandle");

            var result = NativeMethods.SQLSetEnvAttr(environmentHandle, attribute, value, 0);

            if ((result != OdbcReturnCode.Success) && (result != OdbcReturnCode.SuccessWithInfo))
            {
                var ex = GetException(environmentHandle, string.Format("Unable to set ODBC environment attribute '{0:G}'.", attribute));

                throw ex;
            }
        }