VB.Net SQL Database

Posted on 2010-01-04
Last Modified: 2013-12-20
Hi Guys,

I am trying to create a database for a program I am creating in VB.Net 2008 Express. One of the columns in the table needs to be an auto number. What data type should I set the column to so that I can achieve this?

Question by:lfaulkneruk
    LVL 11

    Accepted Solution

    When you say auto number I am thinking you want the database to auto assign it, is this correct?

    I would create it as an integer, primary key and set the column to to auto increment...
    LVL 4

    Assisted Solution

    The specifics vary with the DBMS you use.  For SQL Server an "auto increment" column needs to have Identity Specification set to Yes.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now