OK, I gather you are trying to:
- Download and Insert - i.e. download a text file from a server; parse its data; and insert it into an SQL database.
- 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)