예제 #1
0
        public static int GetMaxID(string FieldName, string TableName)
        {
            string strsql = "select max(" + FieldName + ")+1 from " + TableName;
            object obj    = DbHelperACE.GetSingle(strsql);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(int.Parse(obj.ToString()));
            }
        }
예제 #2
0
        public static int GetRecordCount(string _ID, string _tbName, string _strCondition, int _Dist)
        {
            string sql = getPageListCounts(_ID, _tbName, _strCondition, _Dist);

            object obj = DbHelperACE.GetSingle(sql);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(int.Parse(obj.ToString()));
            }
        }
예제 #3
0
        public static bool Exists(string strSql, params OleDbParameter[] cmdParms)
        {
            object obj = DbHelperACE.GetSingle(strSql, cmdParms);
            int    cmdresult;

            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }