oledbcommand ExecuteNonQuery won't update
<p>I have the following code which does a select based upon a string field and a date and if it returns anything then it tries to do an update. The select returns something, however when I do an update the variable "affected" is set to zero, Could this be because of dates? My date variable is set to (in British format) {02/06/2016 13:10:00} when I inspect it, so it does have a time component.</p>

<pre><code>//  DateTime Md, string ht = these are set at this point

var conn = new OleDbConnection();
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\MyPath\\MyDb.accdb";
conn.Open();

var cmdSel = conn.CreateCommand();
cmdSel.CommandText = @"SELECT * FROM MyTable WHERE Md = @MD AND HT=@HT";
cmdSel.Parameters.AddWithValue("@MD", Md);
cmdSel.Parameters.AddWithValue("@HT", ht);

var da = new OleDbDataAdapter(cmdSel);
var ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count &gt; 0)
{
    var cmd = conn.CreateCommand();
    cmd.CommandText = @"UPDATE MyTable SET HS=@HS WHERE Md = @MD AND HT=@HT";
    cmd.Parameters.AddWithValue("@MD", Md);
    cmd.Parameters.AddWithValue("@HT", ht);
    cmd.Parameters.AddWithValue("@HS", hs);
    var affected = cmd.ExecuteNonQuery();
}
</code></pre>