title: C# GetFiles from local variable
body: <p>I am trying to get a path from SQL, create a variable to store the path, and then use GetFiles to get all of the files in that directory.</p>
  
  <p>I have verified that the path exists and, when I write the result, it shows up correctly.  However, I am getting an unknown exception every time it tries to access the directory.  Hopefully someone can point out what I am doing wrong.</p>
  
  <pre><code>SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString);
  
  myConnection.Open();
  
  SqlCommand cmd = new SqlCommand("SELECT FolderSource FROM MonitoredFolders WHERE FolderSource IS NOT NULL", myConnection);
  
  try
  {
       string returnvalue = (string)cmd.ExecuteScalar();
       Console.WriteLine(returnvalue);
       Console.ReadLine();
  
       string[] filepath = Directory.GetFiles("@" + "\"" + returnvalue + "\"", "*.*", SearchOption.AllDirectories);
  }
  
  catch (Exception e)
  {
       Console.WriteLine("{0} Exception caught.", e);
  }
  
  myConnection.Close();
  </code></pre>