For a data integration service, I create four DTSX packages. These were generic packages which needs to be executed one after the another. I tried using SQL Server Agent to schedule it as a JOB which has four steps to be executed sequentially. Unfortunately the package which is working fine is visual studio is not working when scheduled. There seems to be some permission issues(had the same issue few days before). As i had users waiting the see the output. I have to find an alternative solution soon. Here is the C# code to run the DTSX from a EXEC file.
Code:
Package pkg;
Application app;
DTSExecResult pkgResults;
Variables varStore;
pkgLocation =@"c:\documents and settings\Path\Filename.dtsx";
app = newApplication();
pkg = app.LoadPackage(pkgLocation, null);
varStore = pkg.Variables;
varStore[YourVariable].Value = 123;
pkgResults = pkg.Execute();
Required NameSpace: The reference of Microsoft.SQLServer.ManagedDTS.dll has to be added and in code -
I had an interesting requirement to generate daily reports based on the accumulated sales data. And this Email will be sent to the respective Managers. Thought it would give a better picture if the email have the appropriate Brand images embedded on necessary places in report.
Following code was very much useful to embed an image in a system generated e-mail through C#.
Can across this online tool to convert VB code to C# code & vice versa. this is useful because at times we use to get codes in VB that needs to be converted to C#. Now both of us (VB Guys & C# Guys) can save lot of time :)