Пример #1
0
 public SqlDataAccessStrategy(ReportSettings reportSettings, ConnectionObject connectionObject)
 {
     if (reportSettings == null)
     {
         throw new ArgumentNullException("reportSettings");
     }
     this.reportSettings = reportSettings;
     if (connectionObject == null)
     {
         this.connectionObject = ConnectionObjectFactory.BuildConnectionObject(reportSettings.ConnectionString);
     }
     else
     {
         this.connectionObject = connectionObject;
     }
 }
Пример #2
0
        public static ConnectionObject PrepareConnectionFromParameters(ReportSettings settings,
                                                                       ReportParameters reportParameters)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            ConnectionObject conObj = null;

            if (reportParameters != null)
            {
                if (reportParameters.ConnectionObject != null)
                {
                    conObj = reportParameters.ConnectionObject;
                }
            }

            if (!String.IsNullOrEmpty(settings.ConnectionString))
            {
                conObj = ConnectionObjectFactory.BuildConnectionObject(settings.ConnectionString);
            }
            return(conObj);
        }