>I have a dataset which comes from VFP data. In that data, in VFP, I have character fields and memo fields. However, from the dataset, once a column object is created from the related table, if I use DataType.Name to detect the field type, I obtain String for both fields. I need DataType.Name to be able to recognize that the type when the original source is a memo field. How can I achieve that?
Michel,
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"]);
}
If it's a memo, general or BLOB then ColumnSize is equal to int.MaxValue and IsLong true.
Cetin