How to discover network address of server from within app


Author
Message
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Mind going blank -

what is the syntax to discover the network address of the box with the  sql server my app is connected to?

for some reason I'm drawing a blank on how to reference the application connection ... ??? 

I want to direct temp files for a process to the same box as the sql server ( I'm deserializing and manipulating stored pdfs ) to cut down on WAN traffic on a VPN.
Tags
Replies
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Thanks very much, Trent.  This should get me going.  I have control of the server box so I can precreate the server folders and their permissions.  Just wanted to learn the trick of discovering the server box's name so I didn't have to rely on making it an app setting ( If I did that I was considering pulling it when the connectionmanager first found the database after installation )

Good to know DDT is supporting Filestream as I'm also considering that for some other stuff.

And good luck with Rob Ryan Smile
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Charles R Hankey (1/21/2011)
...I have control of the server box so I can precreate the server folders and their permissions.  Just wanted to learn the trick of discovering the server box's name so I didn't have to rely on making it an app setting ( If I did that I was considering pulling it when the connectionmanager first found the database after installation )

Hi Charles,
Even though you may have control of the network for this application, I would use this server location in a configuration table instead so you can simply choose the location and use it everywhere you need it in your application.

Relying on finding networking shares could be tricky and if for whatever reason in the future the network configuration changes (ex: Server crash, etc) then your application could end up broken.

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Charles.

Expanding a bit from what Trent gave you:

        '-- estabilish locals
        Dim connString As String
        Dim serverName As String
        Dim parseConnString As New Data.SqlClient.SqlConnectionStringBuilder

        '-- get the active connection string
        connString = ConnectionManager.GetApplicationActiveConnectionString("MyApplicationKey", "")
        '-- set the parser connection string
        parseConnString.ConnectionString = connString
        '-- get the server name from the parser
        serverName = parseConnString.DataSource

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
And good luck with Rob Ryan


Yeah...you passed him off to us.  But if you look at the stats, he did improve your defense a lot.  If they keep Colt McCoy in as starter this next year, I think that you may finally have a quarterback!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search