Red Gate forums :: View topic - Compare Options.Default seems to always be on
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

Compare Options.Default seems to always be on

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Tue Jan 18, 2011 9:07 pm    Post subject: Compare Options.Default seems to always be on Reply with quote

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:
    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]
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Thu Jan 20, 2011 6:55 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Wed Jan 26, 2011 11:12 pm    Post subject: Symptoms that make me think it is not working Reply with quote

If I use the same options in the SDK or cmdline vs SQL Compare client. SQL Compare shows no changes, SDK shows changes.
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Fri Jan 28, 2011 3:16 pm    Post subject: Reply with quote

Are you using the very same SQL Compare engine?

What kind of differences does it report?
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Fri Jan 28, 2011 5:04 pm    Post subject: The differences Reply with quote

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
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Thu Feb 03, 2011 3:54 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Mon Feb 07, 2011 4:22 pm    Post subject: Thank you Reply with quote

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:

 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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic 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