예제 #1
0
파일: ODBCDriver.cs 프로젝트: coyove/Luavit
        public bool RetrieveValue(string sqlstatement, ref string result)
        {
            short value = ODBCDriver.SQLExecDirect(this.m_StatementHandle, sqlstatement, -3);

            if (!this.IsOK((int)value))
            {
                return(false);
            }
            value = ODBCDriver.SQLFetch(this.m_StatementHandle);
            if (!this.IsOK((int)value))
            {
                ODBCDriver.SQLCloseCursor(this.m_StatementHandle);
                return(false);
            }
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(1024);
            short num;

            value = ODBCDriver.SQLGetData(this.m_StatementHandle, 1, 1, stringBuilder, 1024, out num);
            if (!this.IsOK((int)value))
            {
                ODBCDriver.SQLCloseCursor(this.m_StatementHandle);
                return(false);
            }
            result = stringBuilder.ToString();
            ODBCDriver.SQLCloseCursor(this.m_StatementHandle);
            return(true);
        }
예제 #2
0
파일: ODBCDriver.cs 프로젝트: coyove/Luavit
        private bool ExecuteSQL(string sqlStmt)
        {
            short value = ODBCDriver.SQLExecDirect(this.m_StatementHandle, sqlStmt, sqlStmt.Length);

            return(this.IsOK((int)value));
        }