Exemple #1
0
 public static object ExecuteScalar(DBServerType type, string connectionString, CommandType commandType, string commandText, params IDbDataParameter[] commandParameters)
 {
     using (IDbConnection connection = I3DBUtil.CreateConnection(type, connectionString))
     {
         connection.Open();
         return(ExecuteScalar(connection, commandType, commandText, commandParameters));
     }
 }
Exemple #2
0
        public static DbDataReader ExecuteReader(DBServerType type, string connectionString, CommandType commandType, string commandText, params IDbDataParameter[] commandParameters)
        {
            DbDataReader  reader;
            IDbConnection connection = I3DBUtil.CreateConnection(type, connectionString);

            connection.Open();
            try
            {
                reader = ExecuteReader(connection, null, commandType, commandText, commandParameters, I3DbConnectionOwnership.Internal);
            }
            catch (Exception ex)
            {
                connection.Close();
                throw;
            }
            return(reader);
        }