| Author |
Message |
wkhazzard
Joined: 08 Mar 2011 Posts: 12 Location: Mid-Atlantic USA
|
Posted: Tue Mar 15, 2011 7:17 pm Post subject: Compare Snapshot to Database |
|
|
I am trying to compare a snapshot to a database using the SQL Compare SDK. I have looked at all the samples and combed through the object model. I can't figure out how to get a SnapshotSource object to behave as a Database object or vice versa. Nor can I find a CompareWith method on the database class that accepts a SnapshotSource or an IDataSource. Is there a sample floating about at Red Gate that shows how to compare a snapshot with a database in the same way that the stand-alone SQL Compare tool does this?
Thanks, _________________ Kevin Hazzard, C# MVP & Friend of Red Gate
http://devjourney.com |
|
| Back to top |
|
 |
james.billings
Joined: 16 Jun 2010 Posts: 840 Location: My desk.
|
Posted: Wed Mar 16, 2011 8:52 pm Post subject: |
|
|
Thanks for your post. I think the snapshotsource is more for creating the snapshots.
If you set it up to work with two Database objects, you should be able to use the "LoadFromDisk" method on one of them to load a snapshot file, i.e:
| Code: |
Database productionDB = new Database();
productionDB.LoadFromDisk(@"c:\snapshots\MySnapshot.snp"); |
|
|
| Back to top |
|
 |
wkhazzard
Joined: 08 Mar 2011 Posts: 12 Location: Mid-Atlantic USA
|
Posted: Fri Mar 18, 2011 3:56 pm Post subject: |
|
|
Thanks, James. Worked like a charm. The LoadFromDisk method name just didn't jump out as the correct way to load a snapshot.
Cheers, _________________ Kevin Hazzard, C# MVP & Friend of Red Gate
http://devjourney.com |
|
| Back to top |
|
 |
james.billings
Joined: 16 Jun 2010 Posts: 840 Location: My desk.
|
Posted: Wed Mar 23, 2011 9:11 pm Post subject: |
|
|
| No, it took me a little while to find that one too! Glad it's working. |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group