Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a VFP .dbf file
Message
De
10/06/2005 18:31:02
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Creating a VFP .dbf file
Versions des environnements
Environment:
C# 1.1
Database:
MS SQL Server
Divers
Thread ID:
01022348
Message ID:
01022348
Vues:
53
I am writing a method that needs to save a DataTable in .dbf format so that it can be imported by a program on another system. Each .dbf file will be read without being modified. The file is for a is a regularly occurring, one-way data export.

I was hoping that I could just use System.IO.File.Create to create a file with a .dbf extension, instantiate an OleDbConnection to open it, and then use SQL commands to CREATE TABLE, INSERT all my DataRows into it, then simply close the OleDbConnection and the .dbf file would be usable.

If the OleDb driver can't create a properly formatted .dbf file from an empty file, since the table in each file will always have the same schema, could I create an empty template .dbf file that contained an empty copy of my table, make a copy of it with File.Copy every time I needed to make a new file, and then populate my copy?

Can it be that easy? I can't find any sample code that does more than read from .dbf files. The examples that I have seen use a couple different values/syntax for the Provider attribute in their connection string, which is confusing.

If anyone has some sample code that they could provide me with, I would appreciate it.

What is the correct provider name to use?

If I am missing a necessary step (or basic understanding), any insight would be useful.

Thanks.
David S. Alexander
Kettley Publishing
20271 SW Birch Street, 2nd Floor
Newport Beach, CA 92660-1752
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform