Hi @Gopinath Desai ,
We can use the following C# code in Script Task to check the OLEDB Connection.
public void Main()
{
try
{
ConnectionManager myOLEDBConnection1 = Dts.Connections["Test OLEDB Connection1"];
MessageBox.Show(myOLEDBConnection1.ConnectionString, "Test OLEDB Connection1 Successfully!");
Dts.Variables["Result"].Value = 1;
}
catch (Exception ex)
{
Debug.WriteLine("Exception Message: " + ex.Message);
MessageBox.Show("Exception Message: " + ex.Message);
Dts.Variables["Result"].Value = 0;
}
Dts.TaskResult = (int)ScriptResults.Success;
}
Please refer to Connecting to Data Sources in the Script Task.
Best Regards,
Mona
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues in November--What can I do if my transaction log is full?
Hot issues in November--How to convert Profiler trace into a SQL Server table?