Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-09-10
13
Medium Priority
?
408 Views
Last Modified: 2012-05-12
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
Comment
Question by:dimensionav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
13 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 36517168
0
 

Author Comment

by:dimensionav
ID: 36519515
I have noticed that the connection string for FOX Pro databases looks for a DBC file but I have DBF Files
0
 

Author Comment

by:dimensionav
ID: 36519523
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.

 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 2000 total points
ID: 36519588
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
 

Author Comment

by:dimensionav
ID: 36519614
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
 

Author Comment

by:dimensionav
ID: 36519892
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
 
LVL 41

Expert Comment

by:graye
ID: 36519942
Just curious... are you working from a 64-bit PC?
0
 

Author Comment

by:dimensionav
ID: 36520069
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
 

Author Comment

by:dimensionav
ID: 36520181
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
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36523015
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
 

Author Comment

by:dimensionav
ID: 36523295
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
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36524501
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
 

Author Closing Comment

by:dimensionav
ID: 36525523
Thank you very much, my demo app is now running.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question