Options

SqlProvider SQLOptions

Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
edited July 21, 2004 7:05AM in SQL Toolkit Previous Versions
Hi Teddi,

I can see how this can cause a problem. The 'sensible defaults' are
subject to change with each release of the software, so there's a
possibility that your application could go ker-blooey on the next upgrade.

One way to check the defaults easily is to open SQL Compare and check
the options. Hit the 'Restore defaults' button and see what's ticked.

You can also do this in your code by logically ANDing each individual
option to Options.Default like this:

CheckOptions(Options.Default)...
static void CheckOptions(Options enOptions)
{

if ((enOptions & Options.IgnoreBindings) ==Options.IgnoreBindings) Console.WriteLine(""Ignore
Bindings" option is set.");

if ((enOptions & Options.IncludeDependencies)==Options.IncludeDependencies)
Console.WriteLine(""Include Dependencies" option is set."); ...

}

Regards,

Brian Donahue
Red Gate Technical Support

"Teddi Easlon" <Teddi.Easlon@ntn.com> wrote in message
news:1pNmRGJLEHA.1528@server53...
> The help for sqlOptions Enumeration descripts Default as "A set of
sensible
> defaults". What are these "sensible" defaults. Is there a way to
determine
> exactly what the defaults are?
>
> Teddi
>
>

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Jamie,

    Even simpler! To specify a set of options, logically OR them together:

    [C#]

    Options enOptions=Options.IngorePermissions | Options.IgnoreComments

    [VB]

    Options enOptions=Options.IngorePermissions Or Options.IgnoreComments


    Regards,

    Brian Donahue
    Red Gate Technical Support

    "Jamie Baxter" <jamie.baxter@watsonwyatt.com> wrote in message
    news:EiW27fTOEHA.1224@server53...
    > This is a great way to inspect the Options.Default.
    >
    > What I would really like to be able to do is to specify SEVERAL of my own
    > options - but I only see a way to use the "Default" or one of my choosing.
    > What if I want to Ignore Comments and Ignore Permissions?
    >
    >
    > "Brian Donahue (Red Gate)" <brian.donahue@red-gate.com> wrote in message
    > news:XHrcuBSLEHA.1428@server53...
    > > Hi Teddi,
    > >
    > > I can see how this can cause a problem. The 'sensible defaults' are
    > > subject to change with each release of the software, so there's a
    > > possibility that your application could go ker-blooey on the next
    upgrade.
    > >
    > > One way to check the defaults easily is to open SQL Compare and
    check
    > > the options. Hit the 'Restore defaults' button and see what's ticked.
    > >
    > > You can also do this in your code by logically ANDing each
    individual
    > > option to Options.Default like this:
    > >
    > > CheckOptions(Options.Default)...
    > > static void CheckOptions(Options enOptions)
    > > {
    > >
    > > if ((enOptions & Options.IgnoreBindings) !=0)
    Console.WriteLine(""Ignore
    > > Bindings" option is set.");
    > >
    > > if ((enOptions & Options.IncludeDependencies) !=0)
    > > Console.WriteLine(""Include Dependencies" option is set."); ...
    > >
    > > }
    > >
    > > Regards,
    > >
    > > Brian Donahue
    > > Red Gate Technical Support
    > >
    > > "Teddi Easlon" <Teddi.Easlon@ntn.com> wrote in message
    > > news:1pNmRGJLEHA.1528@server53...
    > > > The help for sqlOptions Enumeration descripts Default as "A set of
    > > sensible
    > > > defaults". What are these "sensible" defaults. Is there a way to
    > > determine
    > > > exactly what the defaults are?
    > > >
    > > > Teddi
    > > >
    > > >
    > >
    > >
    >
    >
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi All,

    I meant to say a bitwise AND (&) rather than a logical AND (&&). Sorry
    about that.

    Regards,

    Brian Donahue
    Red Gate Technical Support

    "Brian Donahue (Red Gate)" <brian.donahue@red-gate.com> wrote in message
    news:XHrcuBSLEHA.1428@server53...
    > Hi Teddi,
    >
    > I can see how this can cause a problem. The 'sensible defaults' are
    > subject to change with each release of the software, so there's a
    > possibility that your application could go ker-blooey on the next upgrade.
    >
    > One way to check the defaults easily is to open SQL Compare and check
    > the options. Hit the 'Restore defaults' button and see what's ticked.
    >
    > You can also do this in your code by logically ANDing each individual
    > option to Options.Default like this:
    >
    > CheckOptions(Options.Default)...
    > static void CheckOptions(Options enOptions)
    > {
    >
    > if ((enOptions & Options.IgnoreBindings) !=0) Console.WriteLine(""Ignore
    > Bindings" option is set.");
    >
    > if ((enOptions & Options.IncludeDependencies) !=0)
    > Console.WriteLine(""Include Dependencies" option is set."); ...
    >
    > }
    >
    > Regards,
    >
    > Brian Donahue
    > Red Gate Technical Support
    >
    > "Teddi Easlon" <Teddi.Easlon@ntn.com> wrote in message
    > news:1pNmRGJLEHA.1528@server53...
    > > The help for sqlOptions Enumeration descripts Default as "A set of
    > sensible
    > > defaults". What are these "sensible" defaults. Is there a way to
    > determine
    > > exactly what the defaults are?
    > >
    > > Teddi
    > >
    > >
    >
    >
This discussion has been closed.