Connection to database

Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
edited September 16, 2005 11:03AM in SQL Toolkit Previous Versions
Hi Phillip,

Thanks for your post.

The SqlConnectionProperties object doesn't have a property for setting
the port. What you might have to do is to set up a server alias with the SQL
Server Client Network Utility and connect to the alias instead of the real
server. When you make a server alias, there is an option to force it to use
a certain port.

Please let me know if you need more help setting it up.

Regards,

Brian Donahue
Red Gate Technical Support

"Phillip Hemingway" <phil@phileigh.com> wrote in message
news:jvGpVaHLEHA.1240@server53...
> I am in the initial process of evaluating the toolkit for synchronizing
our
> dev/stage/production servers and have one quick question. Is there a way
to
> connect through a firewall without using SQL Server's default port? In
other
> words, can you programmatically set the port for connecting to a server?
>
> Thanks,
>
> Phil Hemingway
> PhiLeigh Consulting
>
>

Comments

  • You can also cheat a little and specify the port information in ConnectionString format to the ServerName property of the ConnectionProperties object like this:

    ConnectionProperties cp=new ConnectionProperties();
    //Connect to localhost on port 8001 using TCP network library
    cp.ServerName="TCP:localhost,8001"
This discussion has been closed.