Skip to main content

Auto Increment ID in Database & Visual Studio

Auto increment is used when we want the ID to update itself automatically.

Click on the ID column. Ensure that the data type is int and unchecked Allow Nulls


Go to the Properties and search for Identity Specification > Is Identity. Choose True then you are done! 

Thank you for reading and feel free to give your opinion or correct me if there is anything wrong with my post.

Comments

Popular posts from this blog

Simple Sign Up / Registration Windows Form with C# (With Hash)

Design your own registration form. Below is the example of a simple registration form. Then create a table in the database (I will post about how to create the table in the SQL database and connect to Visual Studio later).  Open the coding page and ensure that all these using directives are placed on top of the coding page. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Text.RegularExpressions; using System.Data.SqlClient; using System.Security.Cryptography; using System.IO; Then double click on the Sign Up button connection.Open();           SqlCommand command = new SqlCommand("INSERT INTO YourTableName (fullname,username,[password]) VALUES (@nm, @un, @up)", connection); command.Parameters.AddWithValue("@nm", txtfullname.Text)...