Exemple #1
0
        internal string GetDiagSqlState()
        {
            string sqlstate;

            _stmt.GetDiagnosticField(out sqlstate);
            return(sqlstate);
        }
 private void TrySetStatementAttribute(OdbcStatementHandle stmt, ODBC32.SQL_ATTR stmtAttribute, IntPtr value)
 {
     if (stmt.SetStatementAttribute(stmtAttribute, value, ODBC32.SQL_IS.UINTEGER) == ODBC32.RetCode.ERROR)
     {
         string str;
         stmt.GetDiagnosticField(out str);
         switch (str)
         {
         case "HYC00":
         case "HY092":
             this.Connection.FlagUnsupportedStmtAttr(stmtAttribute);
             break;
         }
     }
 }
Exemple #3
0
        private void TrySetStatementAttribute(OdbcStatementHandle stmt, ODBC32.SQL_ATTR stmtAttribute, IntPtr value)
        {
            ODBC32.RetCode retcode = stmt.SetStatementAttribute(
                stmtAttribute,
                value,
                ODBC32.SQL_IS.UINTEGER);

            if (retcode == ODBC32.RetCode.ERROR)
            {
                string sqlState;
                stmt.GetDiagnosticField(out sqlState);

                if ((sqlState == "HYC00") || (sqlState == "HY092"))
                {
                    Connection.FlagUnsupportedStmtAttr(stmtAttribute);
                }
                else
                {
                    // now what? Should we throw?
                }
            }
        }
        void TrySetStatementAttribute (OdbcStatementHandle stmt, ODBC32.SQL_ATTR stmtAttribute, IntPtr value) {

            ODBC32.RetCode retcode = stmt.SetStatementAttribute(
                stmtAttribute,
                value,
                ODBC32.SQL_IS.UINTEGER);

            if (retcode == ODBC32.RetCode.ERROR) {

                string sqlState;
                stmt.GetDiagnosticField(out sqlState);

                if ((sqlState == "HYC00") || (sqlState == "HY092")) {
                    Connection.FlagUnsupportedStmtAttr(stmtAttribute);
                }
                else {
                    // now what? Should we throw?
                }
            }
        }
 private void TrySetStatementAttribute(OdbcStatementHandle stmt, ODBC32.SQL_ATTR stmtAttribute, IntPtr value)
 {
     if (stmt.SetStatementAttribute(stmtAttribute, value, ODBC32.SQL_IS.UINTEGER) == ODBC32.RetCode.ERROR)
     {
         string str;
         stmt.GetDiagnosticField(out str);
         switch (str)
         {
             case "HYC00":
             case "HY092":
                 this.Connection.FlagUnsupportedStmtAttr(stmtAttribute);
                 break;
         }
     }
 }