Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 22nd, 2007, 03:53 PM
Authorized User
 
Join Date: Apr 2006
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default boolean value shows true and false in the datagrid

Hi,
I have to display a report. and the field in the databse has got some boolean values. When i display the recordsin the datagrid it shows as True and False.Can you tell , how can I put X for True and blank space for False.
I am trying to code in C#.
Thank you

 
Old March 22nd, 2007, 08:30 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Assuming you are using SQL Server as your database and the column in question is a data type of Bit you can do this when retrieving your data:

SELECT
   CASE [column]
   WHEN 1 THEN 'X'
   ELSE ' '
   END as [column]
From [table]

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 23rd, 2007, 08:38 AM
Authorized User
 
Join Date: Apr 2006
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much. It worked.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Is 9:00 > 08:30 true or false? cJeffreywang ASP.NET 2.0 Basics 5 February 3rd, 2008 12:16 AM
XSLT - test the value is true or false haixia XSLT 1 August 21st, 2006 01:38 PM
Boolean True/False to Yes/No peterasimpson VB How-To 2 February 6th, 2006 07:58 PM
Displaying Boolean Values from Datagrid rstelma ASP.NET 1.0 and 1.1 Professional 10 January 9th, 2006 01:48 AM
Yes/No in DB showing True/False in ASP query miller2000 Classic ASP Databases 2 June 17th, 2004 10:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.