Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dotnetpro database performance contest
Message
De
15/05/2007 02:07:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/05/2007 21:30:46
Markus Winhard
Lauton Software GmbH
Nürnberg, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
VFP Compiler for .NET
Divers
Thread ID:
01224231
Message ID:
01225436
Vues:
10
>Hi Cetin,
>
>thank you for the sample. Now I understand.
>
>Is there also a command to read the CSV file directly into a database table? (similar to VFP's APPEND FROM)
>
>BTW, did the FMT=Delimited really split the record into distinct fields at your machine? I had to use a Schema.ini file instead to get it split.
>
>[Adressen.txt]
>Format=CSVDelimited
>DecimalSymbol=.
>ColNameHeader=False
>
>
>Markus

It did on mine (but I used ';' as the 'comma', becuase my home computer was configured with European settings - namely Turkish). I forgot to warn you that you might need to add the schema.ini (actually added but later stripped schema.ini writing code in sample). Secondly it's a little weird that CSV doesn't mean CommaSeparatedValue to that provider. Instead it uses 'list separator' as the 'comma' and that changes based on region! For European regions the 'comma' is ';'. It looks like the driver has the same stupidiy as Excel and you could use that for your benefit. Open the file in excel and if it separates the columns instead of putting them all into A column then you have the correct default format for that particular machine. Schema.ini is better and probably it'd be much better if used with tabdelimited.

This is the starter for reading directly into a DataTable. In 2.0 DataTable has a Load method that takes a DataReader (in sample it is using a reader to list records).

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform