Currently Supported Objects: Supported Components (Alpha Release A02)
Simple examples:

1. Creating a package:

iPackage package = new iPackage(password, file, false);

2. Adding a parameter

iVariable pDevMode = package.AddParameter(P_DEVMODE, "Flag will signify if the package should load just a sample of rows (=true) or a full load (false).", devMode);

3. Creating an Oracle connection manager

OleDbConnectionStringBuilder cxBldr = new OleDbConnectionStringBuilder();
oracle = package.AddConnection(ORACLE_CX, iConnection.ConnectionType.OLEDB, string.Format("{0} (OLE DB)", oracleDbServerName), "OLEDB Connection to the Oracle Source Database.");
cxBldr.Add("User ID", oracleUserName);
cxBldr.Add("Password", oraclePassword);
cxBldr.Add("Provider", "OraOLEDB.Oracle.1");
cxBldr.Add("Data Source", oracleDbServerName);

oracle.ConnectionString = cxBldr.ConnectionString;

4. Creating a Sequence task

iSequence loadSequence = package.AddTask<iSequence>("Load Container", "This contains all the actual load steps.");

5. Creating a local variable to the Sequence

 iVariable vThisTable = loopSequence.AddVariable("CurrentTableName", "The current table to be loaded.", "This", string.Format("[{0}]", name));

6. Creating a Sql Script task

iSqlScript sqlGetStatus = loopSequence.AddTask<iSqlScript>("Get Load Status", "Interrogates the database to see if we should attempt to load data into this table.");

iVariable vThisTable = loopSequence.AddVariable("CurrentTableName", "The current table to be loaded.", "This", string.Format("[{0}]", name));
iVariable vTableStatus = loopSequence.AddVariable("TableStatus", "Contains the returned value of the table status check.", 0);

sqlGetStatus.AddParameter(iParameterDirections.Output, OleDbType.Integer, 4, vTableStatus);
sqlGetStatus.Run(vGetStatusScript, ORACLE_CX);

7. Joining tasks together with an expression and constraint

iSqlScript sqlSetLoading = loopSequence.AddTask<iSqlScript>("Set Loading Status", "Sets the status of the table as Loading.");

sqlGetStatus.JoinTaskTo(sqlSetLoading, string.Format("{0} == 0", vTableStatus));

Last edited Dec 17, 2013 at 9:41 PM by RandomThunks, version 3