Compare Options.Default seems to always be on

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

Compare Options.Default seems to always be on

Postby findtim » Tue Jan 18, 2011 9:07 pm

Hi,

I have need to use specific options during my compare and part of the requirement is to not have the default options. I have used the logical OR to add together the options I want, but the default always seems to be used. I have resorted to specifying none as you will see below, but still I see this behavior. And not only in the SDK, but also in the command-line version of SQL Compare. Here is a snippet of code that I used to accomplish the requirements. Where am I going wrong? :

Code: Select all
    Private Const myDefaults As Long = Options.None
    TargetDB.Register(targetConnProps, myDefaults)
    SourceScripts.Register(SourceCodeLocation, New ReadFromFolder.ScriptDatabaseInformation(), myDefaults)
    Dim folderVsDB As Differences
    folderVsDB = TargetDB.CompareWith(SourceScripts, myDefaults)
            Dim difference As Difference
            For Each difference In folderVsDB
                difference.Selected = True
            Next
            Dim work As New Work()
            work.BuildFromDifferences(folderVsDB, myDefaults, False)

RedGate.SQLCompare.Engin.dll version is 8.2.1.7

Any help is much appreciated.[/code]
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm

Postby Chris Auckland » Thu Jan 20, 2011 6:55 pm

Thanks for your post.

I'm not really sure what the problem could be, I've tested it and it and you can configure the options on the command line and using the API.

When you step through the code, what is myDefaults set to?

If it's set to 0, what are the symptoms that make you think it's using the default options?
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Symptoms that make me think it is not working

Postby findtim » Wed Jan 26, 2011 11:12 pm

If I use the same options in the SDK or cmdline vs SQL Compare client. SQL Compare shows no changes, SDK shows changes.
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm

Postby Chris Auckland » Fri Jan 28, 2011 3:16 pm

Are you using the very same SQL Compare engine?

What kind of differences does it report?
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

The differences

Postby findtim » Fri Jan 28, 2011 5:04 pm

When it comes down to it - what I care most about is that it seems to want to include dependencies even those I am not using the default options and I am not choosing Options.IncludeDependencies.

That is the big issue
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm

Postby Chris Auckland » Thu Feb 03, 2011 3:54 pm

Sorry for the delay; I missed your last post.

I'm not sure why the option would be used if it isn't set, I haven't seen that happen before. If you would like me to take a look at your project, feel free to reply to the support ticket we have open for you. (I'll send this message via the ticket as well).

Does the problem also occur if you use one of the sample applications, and remove the 'IncludeDependencies' option?
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Thank you

Postby findtim » Mon Feb 07, 2011 4:22 pm

Chris thank you for your reply about how to address what I was seeing. From my untrained eye it appeared that SQL Compare SDK was pushing dependencies, when really it was refreshing views because of the differences loop logic that I was using.

This logic worked.

Code: Select all
 Dim difference As Difference
 For Each difference In folderVsDB
  If difference.Type = DifferenceType.Equal Then
    difference.Selected = False
  Else
    difference.Selected = True
  End If
 Next


Thanks again.
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests