• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • 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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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