title: Delete file from server
body: <p>I have an application that I am using as a file uploader with an admin panel on the backend of things. I have most of everything completed on it, but I'm running into a wall where I can't delete the physical file from the server. Permissions are correct to allow such action.</p>
  
  <p>On the click of a delete button next to the entry I'm calling the primary ID of the row and as such I'm able to call from the SQL the stored filePath. Here's my code to do so:</p>
  
  <pre><code>DbConn dbConnx = new DbConn();
     SQL = "SELECT filePath FROM database WHERE id='"+ primaryID +"'";
     myReader = dbConnx.createDataReader(SQL);
  string fn44 = Convert.ToString(myReader.Read());
  string url = fn44; //I know redundant
  System.IO.File.Delete(url);
  </code></pre>
  
  <p>All I'm able to gather is that the only information that is pulled is 'true'. I believe this is because I'm trying to convert the information to a string and it doesn't like that. How would I go about taking the value stored in SQL and using it with a variable to perform the delete? </p>
  
  <p>Any help/resources would be greatly appreciated.</p>