﻿<?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 » WinForms (How do I?)  » How to read the current DB connection Title?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 20 May 2026 11:11:30 GMT</lastBuildDate><ttl>20</ttl><item><title>How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20823.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I have several database connections (Local, Remote, etc), so I can do my test, I want to show in the main form the "Title" of the currently selected database connection, so I know which server I am connecting to without having to call the Database Connection Wizard to see this info.&lt;/P&gt;&lt;P&gt;How can I programmatically get the "Title" info of the current connection?</description><pubDate>Mon, 24 Nov 2008 09:37:20 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20868.aspx</link><description>On&amp;nbsp;behalf of&amp;nbsp;Trent:&amp;nbsp;"No problem, glad you got it working!.... Go Cowboys."&lt;/P&gt;&lt;P&gt;:D</description><pubDate>Mon, 24 Nov 2008 09:37:20 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20853.aspx</link><description>Yeap, just what I need, I will add this to my main form base class.&lt;/P&gt;&lt;P&gt;Thanks a lot!</description><pubDate>Fri, 21 Nov 2008 16:45:53 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20852.aspx</link><description>Thanks Trent, I will test it.</description><pubDate>Fri, 21 Nov 2008 16:42:23 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20851.aspx</link><description>Here you go :)&lt;P&gt;[codesnippet]Imports MicroFour.StrataFrame.Data&lt;BR&gt;Imports MicroFour.StrataFrame.Data.BusinessObjects&lt;/P&gt;&lt;P&gt;Public Class Form1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(GetApplicationActiveConnectionStringTitle(ConnectionManager.ApplicationKey, ""))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Returns the active connection string for an application and a specified data source key.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;param name="ApplicationKey"&amp;gt;&amp;lt;/param&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;param name="DataSourceKey"&amp;gt;&amp;lt;/param&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Shared Function GetApplicationActiveConnectionStringTitle(ByVal ApplicationKey As String, ByVal DataSourceKey As String) As String&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Establish Locals&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim loAppData As New DbeApplicationData()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim r As String = ""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Load the application data&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loAppData.FillWithActiveKey(ApplicationKey)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- See if the application key was found&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If loAppData.Count &amp;gt; 0 Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = loAppData.app_title&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Clean Up&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loAppData.Dispose()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Return Results&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return r&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/P&gt;&lt;P&gt;End Class&lt;BR&gt;[/codesnippet]&lt;P&gt;Just FYI, the GetApplicationActiveConnectionStringTitle method is all you need....I just created a test for and threw all of the code in there.</description><pubDate>Fri, 21 Nov 2008 16:25:43 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20849.aspx</link><description>Hi Trent,&lt;/P&gt;&lt;P&gt;Do you have any comment on this one?</description><pubDate>Fri, 21 Nov 2008 16:11:31 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20830.aspx</link><description>It might be, but I don't know of any... which doesn't mean much! :D</description><pubDate>Fri, 21 Nov 2008 11:47:14 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20829.aspx</link><description>Hi Ivan,&lt;/P&gt;&lt;P&gt;Sounds like a bit complicate, is not a property in the connection manager class that will have this info? or a method in there somewhere to get this info?</description><pubDate>Fri, 21 Nov 2008 11:42:25 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: How to read the current DB connection Title?</title><link>http://forum.strataframe.net/FindPost20828.aspx</link><description>Hi Edhy.&lt;/P&gt;&lt;P&gt;I think you would have to fill a load a dataset with the "AppKeys.dat" (OpenXmlFile), CopyDataFrom this dataset table into a BO and then work with it, as it would be filled with your connections' data.</description><pubDate>Fri, 21 Nov 2008 11:30:42 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>