While working on the Visual FoxPro Entity Framework Provider I found myself in a position where I needed to convert schema DataTables into dbfs so that they could be queried. So I created a class that would encapsulate the logic needed to convert DataTables into dbfs with a database container. This blog entry shows how to use DataTableDbcCreator to create VFP tables and database container.
Here is an example:
1: using (var connection = new VfpConnection(ConfigurationManager.ConnectionStrings["Northwind"].ConnectionString)) {
2: connection.Open();
3:
4: var tables = connection.GetSchema(VfpConnection.SchemaNames.Tables);
5: var fields = connection.GetSchema(VfpConnection.SchemaNames.TableFields);
6:
7: connection.Close();
8:
9: var dbc = GetNewDbcFullPath();
10: var dbcCreator = new DataTableDbcCreator(dbc);
11:
12: dbcCreator.Add(tables);
13: dbcCreator.Add(fields);
14: }
This is what was created:

* Example code can be found in Visual FoxPro .Net Examples.