Error: Use of unassigned local variable 'Datafiles'
I know this question is asked several times, but I don't see anything that suits my requirement. please help!
From the following code to check if files exists, I'm getting the following error, any suggestion on how to fix it, I've already included system.IO on top in namespaces
public void Main()
{
// TODO: Add your code here
string DataFilesLocation;
string[] DataFiles ;
DataFilesLocation = Dts.Variables["User::FolderPath"].Value.ToString();
if (DataFiles.Length > 0)
{
Dts.Variables["User::Flag"].Value = true;
}
Dts.TaskResult = (int)ScriptResults.Success;
}
Thanks fr your help in advance.