How to update last row with the time now using C# & SQL Server
<p>My problem is when I update my database record with the time now the time is stopped in specific value and doesn't change.</p>

<p>This is my code </p>

<pre><code>conn.Open();

SqlCommand sq = new SqlCommand("update Hodor_data set leaving_time = ('" + dateTimePicker1.Value.ToString() + "') where mil_no = '" +textBox1.Text+ "' and times = (select max(times) from Hodor_data )", conn);

sq.ExecuteNonQuery();

conn.Close();
</code></pre>

<p>and I tried to change the time by add timer refreshed the datetimepicker every one second but nothing changes and this is my result</p>

<p><a href="https://i.stack.imgur.com/8XNzL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8XNzL.png" alt="img"></a></p>