best practice for Saving boolean in SQL Server
Hi,
I would like to save a boolean value into a SQL Server table and retrieve in C# code. I think the best way to do this is to make the column type 'bit' and fill it with 1's and 0's but I would like to avoid explicit cast in my code when retrieving these values.
Which is the best practice in this case? (by best practice I mean the most inexpensive method, from resource, overhead, execution time, etc point of view)
a. save it as bit and use explicit cast?
(bool)row["boolvalue"] == true
b. save it as tinyint and use ToString()
row["boolvalue"].ToString() == "1"
c. better option I'm not thinking of
P.S. I'm new here, I hope I've posted in the right place and the question is not idiotic. Please let me know if any option is just as good as another.
Have a nice day!