code_junkie

VB .NET (.NET 2.0) Class Library configuration

Nov 12th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. If GetApplicationSetting("connectionString") Is Nothing Then
  2. Throw New Exception("Could not retrieve connection string from .config file")
  3. Else
  4. Return ConfigurationManager.AppSettings.Item("connectionString")
  5. End If
  6.  
  7. If GetApplicationSetting("connectionString") Is Nothing Then
  8. Throw New Exception("Could not retrieve connection string from .config file")
  9. Else
  10. Return ConfigurationManager.AppSettings.Item("connectionString")
  11. End If
  12.  
  13. ConfigurationManager.ConnectionStrings("MyConnectionString")
Add Comment
Please, Sign In to add comment