title: C# : SQL reader.read() determine if connection is interrupted
body: <p>I have a datatable that shows the data of a textfile. This datatable will then be used to update a row/rows that matches the an ID in the Database with the ID inside the text. A scenario will be like:</p>
  <p>Textfile:</p>
  <h1>[TxtId][name][address]</h1>
  <p>1   john   place123 <br />
  2   doe    place456 <br />
  3   jes    place789</p>
  <p>Sql table:</p>
  <h1>[Id][TxtId][items]</h1>
  <p>1     1     bag <br />
  2     1     pencil <br />
  3     1     pen <br />
  4     2     bag</p>
  <p>I want to know that in this row line, if the id from textfile matches the txtid in the table. It will execute an update, at the same time, it will generate a log file in each line of row in the reader to see if the data really updates,then it will increment a counter in update counter given that all of the matches of that id are updated to the database, error count will be incremented otherwise. Now, my problem is how will
  I know if <strong>while(reader.read())</strong> is reading the last row so that i will know that id 1 in text file is fully updated to the database</p>