private string CreateTempDbc() { var dbc = GetNewDbcFullPath(); using (var connection = GetConnection()) { var tables = connection.GetSchema(VfpConnection.SchemaNames.Tables); var dbcCreator = new DataTableDbcCreator(dbc); tables.TableName = "temp"; dbcCreator.Add(tables); } return(dbc); }
private static void Main(string[] args) { using (var connection = new VfpConnection(ConfigurationManager.ConnectionStrings["Northwind"].ConnectionString)) { connection.Open(); var tables = connection.GetSchema(VfpConnection.SchemaNames.Tables); var fields = connection.GetSchema(VfpConnection.SchemaNames.TableFields); connection.Close(); var dbc = GetNewDbcFullPath(); var dbcCreator = new DataTableDbcCreator(dbc); dbcCreator.Add(tables); dbcCreator.Add(fields); } }
public void TestAllTypes() { var actual = CreateDataTable(); //DataTableHelper.WriteDataTableCode("Expected", actual); var creator = new DataTableDbcCreator(this.fixture.DbcPath); creator.Add(actual); var expected = new DataTable(actual.TableName); using (var connection = this.fixture.CreateConnection()) { var sql = string.Format("select * from '{0}'", actual.TableName); var adapter = new VfpDataAdapter(sql, connection); adapter.Fill(expected); } }
public void TestAllTypes() { var actual = CreateDataTable(); //DataTableHelper.WriteDataTableCode("Expected", actual); var dbcPath = Path.Combine(TestContext.TestDeploymentDir, @"Data\MyTest.dbc"); var creator = new DataTableDbcCreator(dbcPath); creator.Add(actual); var expected = new DataTable(actual.TableName); using (var connection = GetConnection(dbcPath)) { var sql = string.Format("select * from '{0}'", actual.TableName); var adapter = new VfpDataAdapter(sql, connection); adapter.Fill(expected); } Console.WriteLine(dbcPath); }