Display of Bit Field on UI

Display of Bit Field on UI

Fields with ‘Bit’ Data Types, when displayed on Web Pages show as True/False. They don’t show the actual ‘0’ / ‘1’.

If you are using a DataReader to retrieve such data, you could cast them explicitly to Int and show them with the actual values as shown below.

while (dr.Read ()){     Response.Write (Convert.ToInt16 ( dr["bitcolval"]));}

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist