Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recognizing memo fields in VFP
Message
De
26/04/2006 23:29:39
 
 
À
16/04/2006 18:23:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
01113940
Message ID:
01116951
Vues:
17
>AFAIK datacolumn doesnit give you any clue about it (very strange, it is now 2.0 and still a big feature is missing).
>OTOH you could use a datareader and get schema table. ie:(in C#)
>
> OleDbConnection cn = new OleDbConnection("Provider=VFPOLEDB;"+
>  @"Data Source=C:\Program Files\Microsoft Visual FoxPro 9\Samples\Data\testdata.dbc");
> cn.Open();
> OleDbCommand cmd = new OleDbCommand("select * from employee", cn);
> OleDbDataReader rdr = cmd.ExecuteReader();
> DataTable dt = rdr.GetSchemaTable();
> cn.Close();
>
> foreach (DataRow row in dt.Rows)
> {
>   Console.WriteLine("Name:{0},Type:{1},Length:{2},Islong:{3}",
>      row["ColumnName"],
>      row["DataType"],
>      row["ColumnSize"],
>      row["IsLong"]);
>  }
>
It turned out that the size is not returned for numeric field. So, I adjusted my framework to use your approach instead which works very well.

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform