StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
How to discover network address of server from within app
How to discover network address of server from within app
Post Reply
Like
2
How to discover network address of server from within app
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Trent Taylor
Trent Taylor
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
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!
Reply
Like
2
Ivan George Borges
Ivan George Borges
posted 13 Years Ago
ANSWER
Post Details
Share Post
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
Reply
Like
2
Edhy Rijo
E
Edhy Rijo
posted 13 Years Ago
ANSWER
Post Details
Share Post
E
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
Reply
Like
1
Charles R Hankey
Charles R Hankey
posted 13 Years Ago
ANSWER
Post Details
Share Post
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
Reply
Like
2
Trent Taylor
Trent Taylor
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
Well, this would depend on how you are trying to accomplish this. You can get the machine name / IP address out of the connection string from the data source, but this won't give you the share of that machine. If you just have a machine name, you can use the
Dns.Resolve("MachineName")
to get the IP of the machine. But if you have the machine name that too may be enough. The second part of this is knowing the share of the machine. Before we move on, another way to parse a connection string is to place it in an SqlConnectionStringBuild and you get get the machine part:
System.Data.SqlClient.SqlConnectionStringBuilder sql = new SqlConnectionStringBuilder(MicroFour.StrataFrame.Data.DataBasics.DataSources[""].ConnectionString);
After you have the machine name, there are other obstacles before you can start writing files. One thought may be to use the new FILESTREAM option in SQL Server 2008. The DDT supports this now as well if you choose to go down this path. This can be more complicated on deployment, but the files are stored externally from SQL but processed through SQL. This way you can use Express and not eat into your database size while still going through your data process.
Reply
Like
2
Charles R Hankey
Charles R Hankey
posted 13 Years Ago
ANSWER
Topic Details
Share Topic
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
connection
Reply
Like
2
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
2
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search