SSIS Flat File to FTP - c#

I have searched everywhere for this answer. I am setting up a Data flow task to pull Data from a table using a customer sql script, it then saves it as a flat file with dynamic naming called NMC Services_(Date Range). the issue is i need to take this one file and upload it onto an FTP Site but i continue to get one of 5 errors:
Error at Package: The connection "FilePath\NMC Service Requests_0606-0612.csv" is not found. This error is thrown by Connections collection when the specific connection element is not found.
Error at FTP Task [FTP Task]: For the FTP operation "Send", the FILE connection manager "File Path\NMC Service Requests_0606-0612.csv" can not be found.
Error at FTP Task: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
using a variable or expression doesn't change it. The file writes to the file path but does not go out and grab it.
This isn't copied it is built from scratch.
When using a variable i get this
Error at FTP Task: Failed to lock variable "File Path\NMC Service Requests_0606-0612.csv" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".
Error at FTP Task: The Validate method on the task failed, and returned error code 0x80131500 (Failed to lock variable "File Path\NMC Service Requests_0606-0612.csv" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".
). The Validate method must succeed and indicate the result using an "out" parameter.
Error at FTP Task: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
I have rebuilt the whole Package from scratch over and over again and still have the issue.

I was able to figure out the issue. I am using an expression to determine the name of the file that it is needing to send. When I set up the variable I put the file path to the file as the value, and then setting evaluate as expression true. I erased the value and placed the expression i use to dynamically name the file in the variable properties under expression and it works like a charm. Thanks for the help!

Related

Could not found the path for create and write file

My code is
after run on Azure it say:
{
"Message": "Cannot create 'D:\\home\\site\\wwwroot\\DataFile' because a file or directory with the same name already exists."
}
how to resolve this??? My code tells it if the directory exists will be ignored and pass not created...why does it try to create and tell can not create because the directory exists???
Work in local work well...no error...the problem appears when run in azure
If I remove the code create a directory, It will error that the path does not exist and it doesn't create and write file...
In Azure
In Local
This code work OK
In Azure it cause error be cause in D:\home\site\wwwroot\DataFile have a DataFile, it is a file,
I use the Kudu, (In App Service in Azure, search Advanced Tools)
then remove the file DataFile, then all things OK
Thanks all for support me!

"Could not find a part of the path" for windows client

I have a WPF client app. I'm try to get access to c:\programdata\, which I can clearly see is available. When I use File.Copy() and c:\programdata\ as the destination, I get this error:
Could not find a part of the path
Anyone know what is wrong?
The File.Copy documentation states that destFileName is:
The name of the destination file. This cannot be a directory or an existing file.
You say you are passing C:\\programdata\\. That is a directory. You have to provide the path and the file name.
For example:
File.Copy("C:\\programdata\\source.txt", "C:\\programdata\\dest.txt");

overwrite file in ftp rename command

I have a ftp application. This application uses ftp rename command. If a file already exists in a directory which the file is renamed to, the error message 'the file not avaliable' caught. What can I do in c# to overwrite a file? In IIS there is a setting for this. When I do this, there is no problem.But,can I do this from c#?
What happens when there is a name collision depends on the server, if you cannot configure a known behaviour on each server you connect to you need to deal with it manually.
Either attempt a rename, catch the exception, delete the file then rename again or check for the files existence first (by requesting it size for example) and deleting it if found.

Parser error in c# application

My system shuts down and then my application starts giving me the below error
Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.
Parser Error Message:
'Project_management.ProjectDetails_Datewise' is not allowed here
because it does not extend class 'System.Web.UI.Page'.
I have deleted folders from temporary file.
Create a new file same way you have tried the last time. Check the difference between both file's aspx page (not the codebehind).
Copy the namespace from newly create file and it will work.

"Attempt to redirect activation..." exception

My application has an HTTP channel to run a method on a remote computer. I'm able to do that with one computer by using the line:
System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownClientType(
typeof(RemoteObject), uri);
I also need to run another method on another computer. So I used the same line as above but changed the URI to the name of the other remote computer. However, I am getting this RemotingException:
Attempt to redirect activation of type 'RemoteClass.RemoteObject, RemoteObject'
which is already redirected.
I've done some research on this exception but haven't found too much information about it. I've looked at the documentation for the exception, but don't really understand it. I tried to find the cause of the error, and learned that if I change the parameter typeof(RemoteObject) such that typeof() is applied to an object of a different type, it works fine. But I still need to use RemoteObject as the type in order to run a method from that class. Is there a work around for this?

Categories