예제 #1
0
        public DataTable GetDataTable(string tblname)
        {
            TableUnit unit  = null;
            DataTable table = null;

            AcquireReadTableLock(tblname);

            try
            {
                unit  = mTableUnitManager.GetTableUnit(tblname);
                table = unit.GetTable();

                string message = string.Format("GetDataTable {0}: {1} rows", tblname, table.Rows.Count);
                mLogHelper.LogMessage(mClientKey, message, LogType.GetTable);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ReleaseReadTableLock(tblname);
            }

            return(table);
        }
예제 #2
0
        public int GetTableRowCount(string tblname, string dbname)
        {
            int nRet            = 0;
            TableUnitManager tm = TableHelper.GetTableUnitManangerByDbname(dbname);

            if (tm != null)
            {
                bool bRet = tm.ExistTable(tblname);
                if (bRet)
                {
                    TableUnit unit  = tm.GetTableUnit(tblname);
                    DataTable table = unit.GetTable();
                    nRet = table.Rows.Count;
                }
            }
            return(nRet);
        }