Live Chat Icon For mobile
Live Chat Icon

A field with bit data type value when displayed on a web page shows true/ false how to display a bit value as 1/0

Platform: ASP.NET| Category: ADO.NET

VB.NET

’Using DataReader
While dr.Read()
  	 Response.Write((dr('ProductName') + ' '))
	 Response.Write((Convert.ToInt16(dr('discontinued')) + ' 
'))
End While

C#

//Using DataReader
while (dr.Read ())
{
	Response.Write (dr['ProductName'] + ' ');
	Response.Write (Convert.ToInt16 ( dr['discontinued']) + ' 
');
}

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.