Download Microsoft OLE DB Provider for Visual FoxPro 9.0 and use:
string connectionString = @"Provider=VFPOLEDB.1;Data Source=D:\temp";
using (OleDbConnection connection = new OleDbConnection(connectionString))
using (OleDbCommand command = connection.CreateCommand())
{
connection.Open();
OleDbParameter script = new OleDbParameter("script", @"CREATE TABLE Test (Id I, Changed D, Name C(100))");
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "ExecScript";
command.Parameters.Add(script);
command.ExecuteNonQuery();
}
Edit: The OP does not want a FoxPro DBF format but dBase IV format:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\temp;Extended Properties=dBase IV";
using (OleDbConnection connection = new OleDbConnection(connectionString))
using (OleDbCommand command = connection.CreateCommand())
{
connection.Open();
command.CommandText = "CREATE TABLE Test (Id Integer, Changed Double, Name Text)";
command.ExecuteNonQuery();
}
create table
command directly using the vfpoledb provider. It's cumbersome, but it might work. – Journalese