title: Get list of databases user has access to
body: <p>I have a SQL Server 2008 instance with several databases and I'm currently writing a C# application to access those databases. In this app, the end user can select a database they want to connect to.</p>
  
  <p>I already have a list of all databases on the server, how can I limit that list to those databases the user can log in to? Or, how can I query that list?</p>
  
  <p>There's a lot of databases, but each user can only access some of them, so trying to connect and catching the Exception is probably not a good idea.</p>
  
  <p>Fyi: The server is configured for Windows authentication only, and the logins to the server are created for Windows' user groups (not individual users).</p>