title: c# Access inserting new data to table with autonumber
body: <p>I have a table with these columns:</p>
  
  <pre><code>PersonID AutoNumber PrimaryKey
  TCKimlikNo Number
  PersonName Text
  PersonSurname Text
  Address Text
  Birthdate Text
  CategoryID Number
  </code></pre>
  
  <p>When im trying to insert value from c# I am using this query:</p>
  
  <pre><code>INSERT INTO Person(TCKimlikNo, PersonName, PersonSurname, Adress, BirthDate, CategoryID) 
  VALUES(@tcKimlikNo, @personName, @personSurname, @adress, @birthDate, @categoryId)
  </code></pre>
  
  <p>But it says: </p>
  
  <blockquote>
    <p>"Microsoft Access set 1
    field to Null due to type conversion
    failure, and it didn't add 0 record(s)
    to the table due to key violations, 0
    record(s) due to lock violations, and
    0 record(s) due to validation rule
    violations."</p>
  </blockquote>
  
  <p>I think the error occuring because of that autonumber column. Access trying to insert null value to that, but field wont let it.  In SQL this query works perfectly. But Access is just annoying.</p>