예제 #1
0
        public static int getMax(IDbPersist oConn, string coluna, string tabela, string where)
        {
            string sql = " select max(" + coluna + ") from " + tabela + where;


            object cod = oConn.executeScalar(sql);

            if (cod != null && cod.ToString() != String.Empty)
            {
                return(Convert.ToInt32(cod.ToString()));
            }

            return(0);
        }
예제 #2
0
 /// <summary>
 /// Executing a scalar function
 /// </summary>
 /// <param name="oConn"></param>
 /// <param name="sql"></param>
 /// <returns></returns>
 public static object executeScalar(IDbPersist oConn, string sql)
 {
     return(oConn.executeScalar(sql));
 }