Heres my code:
Database liveDatabase = new Database();
liveDatabase.RegisterForDataCompare(liveConnectionProperties);
Database snapshotDatabase = new Database();
snapshotDatabase.LoadFromDisk(snapshotPath);
Differences differences = liveDatabase.CompareWith(snapshotDatabase, Options.None);
foreach (Difference difference in differences)
{
difference.Selected = true;
}
Work work = new Work();
work.BuildFromDifferences(differences, Options.None, false);
ExecutionBlock executionBlock = work.ExecutionBlock;
BlockExecutor blockExecutor = new BlockExecutor();
blockExecutor.ExecuteBlock(executionBlock,
liveDatabase.ConnectionProperties.ServerName,
liveDatabase.ConnectionProperties.DatabaseName,
liveDatabase.ConnectionProperties.IntegratedSecurity,
liveDatabase.ConnectionProperties.UserName,
liveDatabase.ConnectionProperties.Password);
When run this line "work.BuildFromDifferences(differences, Options.None, false);" throws the null reference exception.
Here's the stack trace:
at RedGate.SQLCompare.Engine.Dependencies.OrderedList(IDictionary workitems)
at _32._1(Dependencies , Boolean )
at RedGate.SQLCompare.Engine.Work._1(ExecutionBlock , Options , Database , Database , _29 )
at RedGate.SQLCompare.Engine.Work.GenerateSql(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Options options, Boolean runOnTwo)
Any thoughts?
When run this line "work.BuildFromDifferences(differences, Options.None, false);" throws the null reference exception.
Here's the stack trace:
Any thoughts?