title: Programatically retrieve the full data directory path in VB.NET
body: <p>I am working on a <code>VB.NET / WPF</code> application which will use <code>SQL Compact Edition</code> databases.</p>
  
  <p><strong>The application should allow the user to save and load different versions of the database.</strong></p>
  
  <p>To do this, my intention was to have a standard database name (e.g. myDatabase.sdf) which would be saved in the <code>DataDirectory</code>.</p>
  
  <p>Then the user would have an option to save a version of the current data (calling it what they want e.g. savedDatabase1.sdf) and the application would then take a copy of the database from <code>DataDirectory</code> and save it to another location (e.g. a <code>SavedDatabase folder created in the Windows app data area</code>)
  and to load a different version of the database, the application could copy the database from the SavedDatabase folder and overwrite the database in the <code>DataDirectory</code> location.</p>
  
  <p>I can see solutions for overriding the data directory location, <strong>but I can't find any code which allows you to retrieve the path of the  current data directory folder so it can be used in any file copy activities as described above</strong>.</p>
  
  <p>So my question is -  <strong>How do I programmatically retrieve the full path currently being used as the data directory?</strong></p>