Hi there,
The following code is used to check the file date of my file and if it is more recent then the current saved date the new date replaces it. I am currently getting the Error: The type or namespace name 'fileInfoNew' could not be found (are you missing a using directive or an assembly reference?)
Can anyone help please...
theusing System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.IO;
namespace ST_18ff7a6acad54a089ed1d4a93700a713.csproj
{
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
public void Main()
{
string[] sourceFiles = Directory.GetFiles(Dts.Variables["Y:\\Monoday\\Rachael\\PromasterFiles\\Partners YTD Promaster Monthly Transaction list.xlsx"].Value.ToString());
DateTime highestDate = new DateTime();
int lastDate = 01/07/11 ;
int fileInfo;
int fileInfoNew;
Boolean runPackage = false;
foreach (string currentFile in sourceFiles)
{
fileInfo = new fileInfoNew(currentFile);
if (fileInfo > lastDate)
{
lastDate = fileInfo;
runPackage = true;
}
}
Dts.TaskResult = (int)ScriptResults.Success;
}
}
}
1 Replies - 694 Views - Last Post: 24 July 2011 - 10:00 PM
#1
Error: The type or namespace name 'fileInfoNew' could not be f
Posted 24 July 2011 - 07:33 PM
Replies To: Error: The type or namespace name 'fileInfoNew' could not be f
#2
Re: Error: The type or namespace name 'fileInfoNew' could not be f
Posted 24 July 2011 - 10:00 PM
you probably want to do "new FileInfo(currentFile);" instead of "new fileInfoNew(currentFile);"
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|