frenchie
frenchie

Reputation: 51917

casting a tiny int from SQL server

I'm using linq to sql to populate a list of objects. One of the fields I'm interested in is stored as a tinyint. How should I declare this property type in my object definition? As a Short? Byte? Int16?

Thanks.

Upvotes: 19

Views: 43122

Answers (5)

Manish Singh
Manish Singh

Reputation: 371

If your's tinyint is tinyint(1) then you can cast it to bool.

Upvotes: 0

egrunin
egrunin

Reputation: 25053

It's an unsigned byte, so Byte.

Upvotes: 1

Mark Avenius
Mark Avenius

Reputation: 13947

It will be a byte. Here is a complete list.

Upvotes: 44

dotjoe
dotjoe

Reputation: 26940

Byte

[some extra characters..]

Upvotes: 1

Austin Salonen
Austin Salonen

Reputation: 50215

It's a byte.

MSDN SqlDbType

Upvotes: 3

Related Questions