예제 #1
0
 public DateTime GetDBDate()
 {
     try
     {
         string   sql = "select getdate()";
         object   ob  = DbHelperSQL2.GetSingle(sql);
         DateTime dt  = Convert.ToDateTime(ob);
         return(dt);
     }
     catch
     {
         return(DateTime.Now);
     }
 }
예제 #2
0
        public string GetStringData(string sql, Hashtable pararm = null)
        {
            string strobj = string.Empty;
            //     SqlParameter[] parameters = BuildSqlParameters(pararm);
            object ob = DbHelperSQL2.GetSingle(sql, pararm);

            try
            {
                if (ob != null)
                {
                    strobj = ob.ToString();
                }
            }
            catch
            {
            }

            return(strobj);
        }
예제 #3
0
        public double GetDoubleData(string sql, Hashtable pararm = null)
        {
            double dValue = 0;
            object ob     = DbHelperSQL2.GetSingle(sql, pararm);

            try
            {
                if (ob != null)
                {
                    if (double.TryParse(ob.ToString(), out dValue))
                    {
                        return(dValue);
                    }
                    return(0);
                }
            }
            catch
            {
            }

            return(dValue);
        }
예제 #4
0
        public int GetIntData(string sql, Hashtable pararm = null)
        {
            int intValue = 0;
            //     SqlParameter[] parameters = BuildSqlParameters(pararm);
            object ob = DbHelperSQL2.GetSingle(sql, pararm);

            try
            {
                if (ob != null)
                {
                    if (int.TryParse(ob.ToString(), out intValue))
                    {
                        return(intValue);
                    }
                    return(0);
                }
            }
            catch
            {
            }

            return(intValue);
        }
예제 #5
0
        //public int UIDTran(Dictionary<string,IList<SqlParameter>> SQLStringList)
        //{
        //    Dictionary<string, SqlParameter[]> tranSQLStringList = new Dictionary<string, SqlParameter[]>();
        //    foreach (KeyValuePair<string, IList<SqlParameter>> myDE in SQLStringList)
        //    {
        //        IList<SqlParameter> htParams = (IList<SqlParameter>)myDE.Value;
        //        SqlParameter[] parameters = htParams.ToArray<SqlParameter>();
        //        tranSQLStringList.Add(myDE.Key, parameters);
        //    }

        //    return DbHelperSQL2.ExecuteSqlTran(tranSQLStringList);
        //}



        public object GetSingle(string sql, Hashtable pararm = null)
        {
            // SqlParameter[] parameters = BuildSqlParameters(pararm);
            return(DbHelperSQL2.GetSingle(sql, pararm));
        }
예제 #6
0
        public int GetMaxID()
        {
            string sql = "select seq_id.nextval from dual";

            return(Convert.ToInt32(DbHelperSQL2.GetSingle(sql)));
        }