title: How to backup SQL Server database (mdf) programmatically to later import it rowwise?
body: <p>My aim is to backup a database (.mdf) as one file with my web application project written in C#.
  The backup should later on be loaded on a "restore"-page, where the data in the backed-up tables could be appended to the original database row by row.
  What would be a good practice to implement this?
  I thought of just copying the mdf file, but then I read about attaching and detaching of the database. Furthermore I don't know what to do with the _log.ldf file.</p>
  
  <p>I'm looking forward to your hints. Thank you in advance for your help!</p>
  
  <p>EDIT: I can only use the free SQL Server Express for this, because I want to distribute my program to other people.</p>