Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.9k views
in .NET FTP by
I am search of better tools...
Will edtftp.net allow me to upload/download between a text file on a Unisys mainframe and a table in a SQL database? How would I go about doing this in a C# Windows application?

thanks for any assistance.

5 Answers

0 votes
by (51.6k points)
That doesn't really sound like an application for FTP. You should be able to find a range of tools that'll do that though. What sort of database would you like to connect to?

- Hans (EDT)
0 votes
by
thanks for replying.

I've been asked to replace an old DOS application that makes an external call to ftp.exe to connect to the Unisys mainframe and upload/download a text file on that mainframe. I was hoping to bring that import/export process into a .net application (I have used an ftpclass in the past to make calls to an ftp server, but have not been able to do that when the target is not specifically an ftp server). Once I retrieve the text file, I want to put the data into a SQL table, from which the users can work the data (they are currently working that data in a dbf environment).
0 votes
by (51.6k points)
OK, I gather you are trying to:
  1. Download and Insert - i.e. download a text file from a server; parse its data; and insert it into an SQL database.
  2. Query and Upload - i.e. query data from an SQL database; build a text file; and upload it to a server.


You can certainly use edtFTPnet and .NET's database functionality to do that. You could use the FTPConnection.DownloadStream and FTPConnection.UploadStream methods with a MemoryStream, but if the files are going to be very large, then it's safer to use temporary files.

For Download and Insert, you'd download the file using:
  FTPConnection cxn = new FTPConnection();
  cxn.ServerAddress = "address of server";
  cxn.UserName = "your user-name";
  cxn.Password = "your password";
  cxn.Connect();
  cxn.ChangeWorkingDirectory("directory on server");
  cxn.DownloadFile("full file-path on local disk", "file-name on server");
  cxn.Close();

After that you obviously need to parse the file you've just downloaded. You'd probably then use the classes in the System.Data and System.Data.OleDb namespaces to insert the data into the tables in your database.

Query and Upload is similar except you do the querying first, then build the text file on the local disk and then upload using:
  cxn.UploadFile("full file-path on local disk", "file-name on server");


Easy.

- Hans (EDT)
0 votes
by
Thanks again for working with me on this.

I brought edtftpnet into my app and set up a download process.

There is a problem, however, and I'm hoping edtftpnet has a way to deal with it.

Unisys requires userid, password, and account. Is there a way for us to pass the account through in the connection we are establishing?
0 votes
by (162k points)
After you login you may be able to use the Quote command to send account info - use FTPClient instead of FTPConnection.

Alternatively, be nice and buy a source license off us and we'll implement it for you within a day or so.

http://www.enterprisedt.com/products/ed ... chase.html

Thanks again for working with me on this.

I brought edtftpnet into my app and set up a download process.

There is a problem, however, and I'm hoping edtftpnet has a way to deal with it.

Unisys requires userid, password, and account. Is there a way for us to pass the account through in the connection we are establishing?

Categories

...