Are you using ADO.NET, Data Source, or Entity Framework?
The way I would go about it to create a Data Source. Within that DataSource would be the table with the Start and Stop columns. When the value changes from 0, create a row and add it to the table and set the Start Time. Once the value goes back to 0, set the Stop Time to the row in the table. Call Update with a Table Adapter to send the changes to the DB, then clear the table so it is record for the next event.