c# Int type when inserting to SQL bigint

Posted on 2009-04-27
Last Modified: 2012-06-27
Should it be int, int32 or int64?
Question by:andrewmilner
    LVL 29

    Expert Comment

    C# equivalent of bigint is long. However you may insert you value as int (int and int32 are same)
    LVL 29

    Accepted Solution

    Yeah, just in case. When reading bigint from a database you need to convert it to Long datatype (64bit), because bigint might be much bigger than C# int:

    int                           32               147483648 to 2147483647
    long                         64              -9223372036854775808 to 9223372036854775807
    LVL 29

    Expert Comment


    int                           32               -2147483648 to 2147483647

    Author Comment

    Many Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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.

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 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

    11 Experts available now in Live!

    Get 1:1 Help Now