Пример #1
0
 public string ExecuteScalar(string sql)
 {
     string result = "";
     switch (_dbConn.DbType)
     {
         case EDbType.MySql:
             object resultObj=new MySqlCommand(sql, mySqlConn).ExecuteScalar();
             result = resultObj ==null?"":resultObj.ToString();
             break;
         case EDbType.Oracle:
             object oracleResultObj = new OracleCommand(sql, oracleConn).ExecuteScalar();
             result = oracleResultObj == null ? "" : oracleResultObj.ToString();
             break;
     }
     return result;
 }