Solved

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

Posted on 2011-09-10
13
393 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
  • 8
  • 4
13 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 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
 
LVL 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 500 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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 74

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 74

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now