Unable to RegisterforDataCompare after RegisterForCompare
paquerj
Posts: 4
Visual Studio 2005 - VB.Net
Vista Ultimate
SQL 2000 Enterprise
I have a program that gives the users the option to syncronize the schema, synchronize the data, or both.
The schema sync alone works fine and the data sync alone works fine.
But if I call the schema sync and then call the data sync after the schema sync completes, the first database using the RegisterForDataCompare gets registered but it looks like the toolkit goes into an endless loop trying to connect somewhere inside the second call to RegisterForDataCompare.
The status reads "Reading Rules", if that helps at all. Any idea why this would be occuring and what to do about it?
It's the same server, two different databases. If I switch the order of the databases being registered it still hangs registering the second one.
Here's the code:
The dbs used in the schema sync routine are disposed of before the call to the data sync.
Vista Ultimate
SQL 2000 Enterprise
I have a program that gives the users the option to syncronize the schema, synchronize the data, or both.
The schema sync alone works fine and the data sync alone works fine.
But if I call the schema sync and then call the data sync after the schema sync completes, the first database using the RegisterForDataCompare gets registered but it looks like the toolkit goes into an endless loop trying to connect somewhere inside the second call to RegisterForDataCompare.
The status reads "Reading Rules", if that helps at all. Any idea why this would be occuring and what to do about it?
It's the same server, two different databases. If I switch the order of the databases being registered it still hangs registering the second one.
Here's the code:
Dim db3 As New Database Dim db4 As New Database Dim datablock As ExecutionBlock SetTextboxText("Initializing data sync...") db3.Status = New StatusEventHandler(AddressOf StatusCallback) If SOURCE_TRUSTED_CONNECTION Then db3.RegisterForDataCompare(New ConnectionProperties(SOURCE_SERVER_NAME, SOURCE_DATABASE_NAME), Options.Default) Else db3.RegisterForDataCompare(New ConnectionProperties(SOURCE_SERVER_NAME, SOURCE_DATABASE_NAME, SOURCE_USERNAME, SOURCE_PASSWORD), Options.Default) End If db4.Status = New StatusEventHandler(AddressOf StatusCallback) If DESTINATION_TRUSTED_CONNECTION Then db4.RegisterForDataCompare(New ConnectionProperties(DESTINATION_SERVER_NAME, DESTINATION_DATABASE_NAME), Options.Default) Else db4.RegisterForDataCompare(New ConnectionProperties(DESTINATION_SERVER_NAME, DESTINATION_DATABASE_NAME, DESTINATION_USERNAME, DESTINATION_PASSWORD), Options.Default) End If
The dbs used in the schema sync routine are disposed of before the call to the data sync.
Robert Paquette
Comments
If you are 'recycling' db3 and db4 for use with both Register and RegisterForDataCompare, these objects are probably being destroyed by the Dispose() method, so you would either need to create them anew after disposing them, for example:
Hopefully that's it!
I don't think that's it. I'm probably doing something stupid but I just don't see it. The project is an upgrade of a VS2003 project that was used to compare against a disconnected database, which worked fine, whereas this one is comparing two live databases. Don't see why that would make a difference, though.
Here's the code, maybe you'll see something obviously wrong:
Thanks,
Robert Paquette
As far as I can see, it must be something about the database that causes this to happen.
I don't think it's database-related because if I switch the order it will connect fine to db4 and hang on db3. I also put a stop on my servername property and it hits it endlessly so it must be retrying the connection. Don't know why the server would let the first three connect but not the fourth.
Weird. No biggie I guess - I'll just have them run seperately.
Thanks.