Beispiel #1
0
        public static bool Exists(string dbKey, string strSql, params MySqlParameter[] cmdParms)
        {
            object obj = DbHelperMySQL3.GetSingle(dbKey, strSql, cmdParms);
            int    cmdresult;

            if (object.Equals(obj, null) || object.Equals(obj, DBNull.Value))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            return(cmdresult != 0);
        }
Beispiel #2
0
        public static int GetMaxID(string dbKey, string FieldName, string TableName)
        {
            string strsql = "select max(" + FieldName + ")+1 from " + TableName;
            object obj    = DbHelperMySQL3.GetSingle(dbKey, strsql);
            int    result;

            if (obj == null)
            {
                result = 1;
            }
            else
            {
                result = int.Parse(obj.ToString());
            }
            return(result);
        }