Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

How to create XML File and then send it by FTP ?

HI

I am new with windows forms apps and vb.net, I would like to know how to create an application that could read a FoxPro database, create an XML file with the query and finally send it through FTP to a website.

Thanks in advance.

0
dimensionav
Asked:
dimensionav
  • 8
  • 4
2 Solutions
 
dimensionavAuthor Commented:
I have noticed that the connection string for FOX Pro databases looks for a DBC file but I have DBF Files
0
 
dimensionavAuthor Commented:
Sorry I have misunderstood the file types that I have to read, I think these are xbase files but not FOX Pro.... am I right?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
käµfm³d 👽Commented:
I have noticed that the connection string for FOX Pro databases looks for a DBC file but I have DBF Files
I can't say that I know what the difference is. However, if you're not sure which connection string to use you can always check here:

    http://www.connectionstrings.com/visual-foxpro

This one:

    http://www.connectionstrings.com/visual-foxpro#p2cs1 (Free Table directory)

appears to deal in DBF, but I'm not really a FoxPro guy so I can't confirm.

0
 
dimensionavAuthor Commented:
The fact of using as a datasource path this: SourceDB =c:\myvfpdbfolder, makes me think that I can perform queries over all the tables (DBF Files) in that directory, right?
0
 
dimensionavAuthor Commented:
I have tried a couple of connection strings but I got the following errors:

 sConn = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\mydbf;"
Driver does not support this function

sConn = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\mydbf;"
DBF External table is not in the expected format
0
 
grayeCommented:
Just curious... are you working from a 64-bit PC?
0
 
dimensionavAuthor Commented:
I am using windows server 2003 32Bits, but seems that the problem was the version of the ODBC driver..
I have downloaded and installed this: http://msdn.microsoft.com/en-us/vfoxpro/bb190233 and now the query is working pretty well.

Now... I will continue with the rest of the project.
0
 
dimensionavAuthor Commented:
kaufmed:

I order to understand better your solution, why I have to use a datareader and then load it into a dataset?, is this because of performance of a datareader vs. datatable?
0
 
käµfm³d 👽Commented:
I mentioned DataReader because you can call DataSet.Load and pass an instantiated DataReader to have the DataSet populated with little effort on your part. DataSet has the GetXml method which will return you the XML version of your DataSet.

Please don't think that this is the only way to achieve what you are after. I felt as though it would be the simplest, but there could be an even simpler method.
0
 
dimensionavAuthor Commented:
kaufmed:

Actually is a good way is just that I am doing another process that brings a table so, I decided to use it but I just wanted to know if a datareader is better in performance than a table.

At this point I can create the XML File, and I have a question:

The structure is like the code attached, this file will be read in a website, I wonder if I need to create the first line like <?xml version="1.0" encoding="utf-8" ?> and stuff like that, related to XML standards or the file is perfect for what I need? (I´m not experienced in XML)

Thanks!

<PRODUCTS>
   <PRODUCT>
     <FIELD1>Value 1</FIELD1>
     <FIELD2>Value 2</FIELD2>
   </PRODUCT>
</PRODUCTS>

Open in new window

0
 
käµfm³d 👽Commented:
You don't have to have an XML declaration in an XML file (the <?xml ... ?> part), but it usually doesn't hurt. If you are unsure, I'd say try it out without the declaration and see if it works; if it doesn't, then you'll most likely have to add it. I can't recall running into a situation where my code failed due to a missing declaration.
0
 
dimensionavAuthor Commented:
Thank you very much, my demo app is now running.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 8
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now