Skip to main content

Posts

Showing posts with the label DataTable

Automatic Numbering for the Primary Key Column

Many of you might have come across an issue of Auto incrementing while working with database products. Truly speaking, recently I also came across one silly problem and thought of sharing it here. Imagine that at some point of time, you might want to send your new data to a back-end database. If your application supplies the auto-increment values, then what will the database do? what if application receives duplicate values from different client applications? The answer is that these auto-increment values are never sent to the database because the auto-increment column in the database table will provide a value whenever a new row is added. After each new row is added, the back-end database table generates a new-increment number and then your application will query the database to get the newly created number. Your application will then update its primary key number to the values that came from the database. This means that all the foreign key references will need t