﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Retrieve Server and Database and Login information</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 05:15:40 GMT</lastBuildDate><ttl>20</ttl><item><title>Retrieve Server and Database and Login information</title><link>http://forum.strataframe.net/FindPost12836.aspx</link><description>&lt;BR&gt;I can get the connectioninfo from; &lt;/P&gt;&lt;P&gt;MicroFour.StrataFrame.Data.DataLayer.DataSources.Item(0).ConnectionString.ToString&lt;/P&gt;&lt;P&gt;However, I How can I separedly retrieve the following from my SF project? &lt;/P&gt;&lt;P&gt;Server Name&lt;/P&gt;&lt;P&gt;Database Name&lt;/P&gt;&lt;P&gt;Server Login &lt;/P&gt;&lt;P&gt;Thanks&lt;BR&gt;</description><pubDate>Wed, 28 Nov 2007 12:11:52 GMT</pubDate><dc:creator>Michael Reese</dc:creator></item><item><title>RE: Retrieve Server and Database and Login information</title><link>http://forum.strataframe.net/FindPost12845.aspx</link><description>Actually there is an easier way if you do not want to parse it yourself.&amp;nbsp; You can pass the connection string into the SqlConnectionStringBuilder class and it will parse the string for you into properties:&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;Dim connInfo As New SqlClient.SqlConnectionStringBuilder(DataBasics.DataSources(0).ConnectionString)&lt;BR&gt;Dim msg As String = ""&lt;/P&gt;&lt;P&gt;&lt;BR&gt;msg &amp;amp;= connInfo.DataSource &amp;amp; ControlChars.CrLf&lt;BR&gt;msg &amp;amp;= connInfo.InitialCatalog &amp;amp; ControlChars.CrLf&lt;BR&gt;msg &amp;amp;= connInfo.UserID &amp;amp; ControlChars.CrLf&lt;BR&gt;msg &amp;amp;= connInfo.Password &amp;amp; ControlChars.CrLf&lt;BR&gt;msg &amp;amp;= connInfo.IntegratedSecurity.ToString()&lt;BR&gt;MsgBox(msg)[/codesnippet]&lt;P&gt;Greg's solution is always a good workaround though if this doesn't give you what you need.</description><pubDate>Wed, 28 Nov 2007 12:11:52 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Retrieve Server and Database and Login information</title><link>http://forum.strataframe.net/FindPost12840.aspx</link><description>Yeah, I was hoping that I would not have to go that route!&lt;/P&gt;&lt;P&gt;Thanks much!</description><pubDate>Wed, 28 Nov 2007 09:18:15 GMT</pubDate><dc:creator>Michael Reese</dc:creator></item><item><title>RE: Retrieve Server and Database and Login information</title><link>http://forum.strataframe.net/FindPost12837.aspx</link><description>The connection string is usually a set of key=value pairs, delimited by semi-colons.  So, a bit of string manipulation will get you there.   Just use the Split function on semi-colons first, then split on each pair on using '='.   Either just test each as you go or you could add them to a dictionary, so you could then just access each value by its  key.&lt;br&gt;
&lt;br&gt;
Hope that makes sense! :D</description><pubDate>Tue, 27 Nov 2007 23:52:51 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>