Hi,
I am using script component in Data Flow as source and i wanted to wrap up my code with try and catch blocks . The language i am using is C#.Net. In the event of of exception i want to log the exception to the flat file in the catch block with some user variables info.
I keep getting the error message when using the Dts variables and i have tried the below code and that too is not working.
can some one help me in providing examples for try catch blocks in Script component .
Code:
catch(Exception ex)
{
bool pbCancel = false;
ComponentMetaData.FireError(0, filename, "An error occurred: " + ex.Message.ToString(), "", 0, out pbCancel);
}