• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • Last Modified:

c# Int type when inserting to SQL bigint

Should it be int, int32 or int64?
0
andrewmilner
Asked:
andrewmilner
  • 3
1 Solution
 
anarki_jimbelCommented:
C# equivalent of bigint is long. However you may insert you value as int (int and int32 are same)
0
 
anarki_jimbelCommented:
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
0
 
anarki_jimbelCommented:
Sorry:

int                           32               -2147483648 to 2147483647
0
 
andrewmilnerAuthor Commented:
Many Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now