Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a VFP .dbf file
Message
 
 
À
10/06/2005 18:31:02
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 1.1
Database:
MS SQL Server
Divers
Thread ID:
01022348
Message ID:
01022476
Vues:
11
Have you thought about creating a simple VFP database (without any tables) and put a stored procedure in this database. This stored procedure can create a table and populate it, if necessary? Then you can easily call this stored procedure from your .NET application. I have done it and it works.

HTH.

>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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform