customize this code
danjaman
Posts: 12
Here is my C# code
as db1.tables I want to make it read from my config file setting called section
and as db2.tables I also want it to read as section.
My config file has sectionGroup
and section which is the list of tables be sectionGroup.
ho to do this. 8)
mappings.CreateMappings(db1.Tables, db2.Tables); session.CompareDatabases(db1, db2, mappings);
as db1.tables I want to make it read from my config file setting called section
and as db2.tables I also want it to read as section.
My config file has sectionGroup
and section which is the list of tables be sectionGroup.
ho to do this. 8)
Comments
Instead of mappings.CreateMappings(db1.Tables, db2.Tables), you would code to add each TableMapping to the TableMappings individually.
That is:
Thats just an example of how to add one Table to Table mapping. When you do it individually like that, you can map Views to Views or even Tables to Views. You should parse your list of tables into a list of strings, and iterate through it, joining each individually using mappings.Join(...).
Note the format of a table name, it is fully qualified, specifying both the schema(owner) and table name like: "[dbo].[myTable]"
Once again, I don't work for Red Gate, but I've become pretty familiar with the toolkit.
That being said, I'm using knowledge gained from version 5.3, not 6.0. If you are using a previous version, you might want this topic moved to the old forum. My knowledge might not work with the new libraries.