title: Dapper ORM Delete functionality with Access
body: <p>Today when I was working with Access, I tried to do one test by changing one of the table name in Access but not updating in the code and trying to observe the behavior </p>
  
  <p>For example, My code is </p>
  
  <pre><code>Product product = new Product();                                                                                                 //Delete Works well
  product.ProductNumber = "P1";
  product.Description = "TestProduct1";
  
  var deleteStatement = @"Delete from Product Where Description = @Description";
  int outp = con.Execute(deleteStatement, new { Description = product.Description });
  </code></pre>
  
  <p>And my Product table in the database is </p>
  
  <p><a href="https://i.stack.imgur.com/JZx3M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JZx3M.png" alt="And my Product table in the database is "></a></p>
  
  <p>Before changing 'Description' as 'Descr' things work perfectly. But after changing it when I ran the code (didn't change anything in the code), it deletes entire table. I am confused. Because it is practical that, somebody accidentally changes the table name and not updating in the code. Why this issue is happening? and how to do a validity check for this?</p>
  
  <p>Personally I think, if the field is not in Access database, it should return an exception or not doing anything</p>
  
  <p><strong>Update</strong> </p>
  
  <p>Currently, I am doing the delete after checking through</p>
  
  <pre><code>con.Query&lt;Products&gt;("select ProductNumber, Description from products")
  </code></pre>
  
  <p>This will generate an exception if proper field names are not in the required table. But this couldn't be the answer for this question. I am expecting a proper answer from somebody</p>