title: Fastest way to import text file into database
body: <p>I've a text file containing record of a dump of database table in a custom format, this text have a character in a specific position that identifies the operation with the record :</p>
  
  <ul>
  <li>M = Insert or Update</li>
  <li>D = Delete Record</li>
  </ul>
  
  <p>Therefore if i find a D record in text file i need to delete record into database, instead if i find an M record i need to Insert the record if not exist in the database, if already exist i need to update it.</p>
  
  <p>What is the better and fastest way to import a similar text file in a database table using .NET Framework and c#?
  I have 300000 record of average in this text file.</p>
  
  <p>Thanks</p>