title: Pass Username/Password to Authenticated Proxy VB.NET - SQL - Simple, but can't figure out
body: <p>Have a simple windows form application (VB.net in VS 2013).</p>
  
  <p>Has one time connection to a SQL database to verify activation key.</p>
  
  <p>Works great, except when program is installed on a computer that requires an authenticated proxy.  Then get the 'not authenticated' error.</p>
  
  <p>SQL connection:</p>
  
  <pre><code> dbSource = "Initial Catalog=MySQLDatabse;Data Source=123.123.123.123;Persist Security  Info=True;User ID=MyUserName;Password=MyPassword"
  
   mySQLConn = New SqlConnection(dbSource)
   mySQLConn.Open()
   mySQLCmd = mySQLConn.CreateCommand
   mySQLCmd.CommandText = "SELECT * FROM Customer WHERE ActKey='1234567'"
   'Rest of Sub Here
  </code></pre>
  
  <p>Have searched for solution, come up empty handed.</p>
  
  <p>By default, when a user opens up a web browser (like for www.stackoverflow.com) on the client computer, proxy server authentication pops up and requests Username and Password.</p>
  
  <p>Do I implement WebProxy?  with .Credentials?</p>
  
  <p>Do I even need to have user enter credentials to access the database (since it's not thru HTTP), or can I just use default credentials in app.config file :</p>
  
  <pre><code>  &lt;system.net&gt;
      &lt;defaultProxy useDefaultCredentials="true" /&gt;
    &lt;/system.net&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>