Is there an accepted method to determine if a string is a valid connection string?
<p>I have a command line app that will be configured in one of two ways:</p>

<ol>
<li>XML file</li>
<li>SQL Server database (specifically Microsoft SQL Server, not a generic "SQL database")</li>
</ol>

<p>To set the config, it will be called with a <code>config</code> command line argument.</p>

<pre><code>myapp.exe -config [some file path]
myapp.exe -config [some connection string]
</code></pre>

<p>So, I will get a string inside the app, and I'll need to figure out which one it is.</p>

<p>Is there an accepted way to determine if a given string is a valid SQL connection string?  I'd love to take either of the two options as the same argument, then just internally figure out if it's a (1) file path, or (2) connection string.</p>

<p>Is there some way to do this, or should I just attempt to locate a file at the path, and assume it's a connection string if the file isn't found?  Or vice-versa?</p>