1 Replies - 694 Views - Last Post: 24 July 2011 - 10:00 PM Rate Topic: -----

#1 ratzy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-July 11

Error: The type or namespace name 'fileInfoNew' could not be f

Posted 24 July 2011 - 07:33 PM

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;
}
}
}

Is This A Good Question/Topic? 0
  • +

Replies To: Error: The type or namespace name 'fileInfoNew' could not be f

#2 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 431
  • View blog
  • Posts: 1,452
  • Joined: 28-April 09

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);"
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1