Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recognizing memo fields in VFP
Message
From
26/04/2006 23:29:39
 
 
To
16/04/2006 18:23:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01113940
Message ID:
01116951
Views:
18
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform