c# and VFP Database

  • Thread starter Thread starter Jacek Jurkowski
  • Start date Start date
J

Jacek Jurkowski

How to get a table sttucture (calling AFIELDS()?) through
VFP OleDB Provider from VFPDatabase to c#?
 
Hi Jacek,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the structure of an VFP
database table. If there is any misunderstanding, please feel free to let
me know.

To achieve this in ADO.NET, we can use OleDbConnection.GetOleDbSchemaTable.
The method can get informations for tables, columns and returns a
DataTable. Here I have written a code snippet which gets column information
for table named "table1".

this.oleDbConnection1.Open();
DataTable dt =
oleDbConnection1.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, new
object[]{null,null,"table1",null});
this.dataGrid1.DataSource = dt;
this.oleDbConnection1.Close();

For more information about OleDbConnection.GetOleDbSchemaTable method,
please check the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemDataOleDbOleDbConnectionClassGetOleDbSchemaTableTopic.asp

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
In news: (e-mail address removed),
Jacek Jurkowski said:
How to get a table sttucture (calling AFIELDS()?) through
VFP OleDB Provider from VFPDatabase to c#?

Hi Jacek,

From the VFP Help, AFields() is only supported in stored procedures, rules,
triggers, and defalut values.
 
Hi Cindy,

From the PracticalTest, AFields() is usefull if you want to get columns
count in VFP table into c# (it works).
 
Hi Jacek,

It was nice to know that you have had the problem resolved. Thanks for
sharing your experience with all the people here. If you have any
questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top