Beispiel #1
0
        private DbCommand GetCommand(ConnectionRef connectionRef, string commandText)
        {
            DbProviderFactory dbFactory = Helper.CreateProviderFactory(connectionRef);

            DbConnection conn = dbFactory.CreateConnection();

            if (conn == null)
            {
                return(null);
            }

            conn.ConnectionString = connectionRef.ConnectionString;

            DbCommand dbCommand = dbFactory.CreateCommand();

            if (dbCommand == null)
            {
                return(null);
            }

            dbCommand.Connection  = conn;
            dbCommand.CommandText = commandText;

            return(dbCommand);
        }
Beispiel #2
0
        internal static DbCommand GetCommand(ConnectionRef connectionRef, string commandText)
        {
            var dbFactory = CreateProviderFactory(connectionRef);

            DbConnection conn = dbFactory.CreateConnection();

            if (conn == null)
            {
                return(null);
            }

            conn.ConnectionString = connectionRef.ConnectionString;

            DbCommand dbCommand = dbFactory.CreateCommand();

            if (dbCommand == null)
            {
                return(null);
            }

            dbCommand.Connection  = conn;
            dbCommand.CommandText = commandText;

            return(dbCommand);
        }
Beispiel #3
0
        internal static DbProviderFactory CreateProviderFactory(ConnectionRef connectionRef)
        {
            DbProviderFactory dbFactory = connectionRef.ConnectionType != ConnectionRef.ConnectionTypeEnum.AdoNet
                                              ? GetReservedFactory(connectionRef.ConnectionString)
                                              : GetFactory(connectionRef.InvariantType);

            return(dbFactory);
        }
Beispiel #4
0
        public Dataset(SsisTestSuite ssisTestSuite, string name, ConnectionRef connectionReference, bool isResultsStored, string query)
        {
            if (ssisTestSuite == null)
            {
                throw new ArgumentNullException("ssisTestSuite");
            }

            Name            = name;
            ConnectionRef   = connectionReference;
            IsResultsStored = isResultsStored;
            Query           = query;
            TestSuite       = ssisTestSuite;
        }
Beispiel #5
0
 public Dataset(SsisTestSuite ssisTestSuite, string name, ConnectionRef connectionReference, bool isResultsStored, string query, DataTable results)
     : this(ssisTestSuite, name, connectionReference, isResultsStored, query)
 {
     Results = results;
 }