示例#1
0
 internal static extern OdbcReturnCode SQLExecDirectW(OdbcStatementHandle statementHandle, [In, MarshalAs(UnmanagedType.LPWStr)] string statementText, int textLength);
示例#2
0
        internal static void ExecuteDirect(OdbcStatementHandle statementHandle, string commandText)
        {
            if (commandText == null) throw new ArgumentNullException("commandText");

            var result = NativeMethods.SQLExecDirectW(statementHandle, commandText, commandText.Length);

            if ((result == OdbcReturnCode.Success) || (result == OdbcReturnCode.SuccessWithInfo)) return;

            var ex = GetException(statementHandle, "Unable to execute command text.");

            throw ex;
        }