title: Inserting auto increment into database ASP.net
body: <p>I'm trying to register a user, with the following query:</p>
  
  <pre><code>"INSERT INTO Users (Username, Password, FirstName, Surname, Age, HouseNumber, 
                      StreetName, Town, County, Postcode, TelephoneNumber, 
                     isBanned, isAdmin) 
   VALUES ('" + textboxUsername.Text + "','" + textboxPassword.Text + "','" + 
               textboxFirstName.Text + "','" + textboxSurname.Text + "','" + textboxAge.Text + "','" + textboxHouseNumber.Text + 
       "','" + textboxStreetName.Text + "','" + 
                textboxTown.Text + "','" + textboxCounty.Text + "','" + 
               textboxPostcode.Text + "','" + textboxTelephoneNumber.Text + 
            "', 'false', 'false')", con);
  </code></pre>
  
  <p>The database is set up as you would expect, with only the above values and UserID, which should be an auto increment value using Identity Specification. However, I get the following error: </p>
  
  <pre><code>Cannot insert the value NULL into column 'UserID', table 'myFilePath'; column does not allow nulls. INSERT fails.
  </code></pre>
  
  <p>Why is this? I can't tell it to insert anything for the UserID as the database needs to handle that, currently the UserID is the primary key and as such can't be not null. What am I doing wrong? This used to work a few months ago</p>