System.Data.Sqlite version = 1.0.60, VS 2005
I have a table that I should have set the Primary Key to be [NewsletterID] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT but, in ignorance I set it to be [NewsletterID] SMALLINT NOT NULL PRIMARY KEY. The result seemed to be that the primary key was not automatically inserted when I inserted a new record in the bound dataview control. So, I changed the table definition in SQLite Administrator and tried again. Same problem. I looked at the source code for the ASP.Net page and found that the SqlDataSource parameters still had the type as Int16 and the INSERT command included the primary key. I think that means it does not recognize the change in definition of the table. (There is a high probability that my inference is completely in error!)
So, what do I do to get the autoincrement to be recognized? I'm running VS 2005 with VB. Would the Entity Framework in VS 2008 make this problem better? I saw in another post that manually changing the StoreGeneratedPattern would make the autoincrement work but I haven't found the file to change.
As a test I created a new project with just a SqlDataSource on it. In this one the ID type is listed as Int64. I also added a page to the original project with a SqlDataSource and the type was still Int16. It seems the program is remembering the schema and not changing it when the table is changed. The designer shows the type to be integer where it previously showed as smallint. Also the INSERT command showed the ID to be inserted.
An explanation of all this would be greatly appreciated. Thanks.