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); }
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); }
internal static DbProviderFactory CreateProviderFactory(ConnectionRef connectionRef) { DbProviderFactory dbFactory = connectionRef.ConnectionType != ConnectionRef.ConnectionTypeEnum.AdoNet ? GetReservedFactory(connectionRef.ConnectionString) : GetFactory(connectionRef.InvariantType); return(dbFactory); }
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; }
public Dataset(SsisTestSuite ssisTestSuite, string name, ConnectionRef connectionReference, bool isResultsStored, string query, DataTable results) : this(ssisTestSuite, name, connectionReference, isResultsStored, query) { Results = results; }