---
title: "Setting default value and displaying in checkboxes"  
description: "Setting default value and displaying in checkboxes"  
author: "Anonymous User"  
published: 2013-05-04  
updated: 2013-05-04  
canonical: https://www.mindstick.com/forum/810/setting-default-value-and-displaying-in-checkboxes  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Setting default value and displaying in checkboxes

Hi Everyone!\
\
Okay so this is a bit of a double [question](https://www.mindstick.com/blog/23175/how-to-solve-neet-question-paper-in-less-time) [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic), but they are both related. The first question is how would I set a [default value](https://www.mindstick.com/forum/2035/default-value-when-using-singleordefault) for my [column as](https://www.mindstick.com/forum/159334/how-to-set-column-as-auto_increment-in-mysql) I want it to be \
\
true/1 (it's a bit column in case you hadn't guessed) and the [second](https://answers.mindstick.com/qa/41761/how-did-the-second-industrial-revolution-influence-women-s-roles-in-society) issue is that I have a row of checkboxes and I want these to be ticked when I have the value set \
\
as true, my current [command](https://www.mindstick.com/blog/178/synchronous-and-asynchronous-command-execution-in-c-sharp-dot-net) is:\
\
cmd.CommandText = "[ALTER TABLE](https://www.mindstick.com/forum/811/alter-table-with-a-default-sql-server-vs-oracle) tbl_ecom_cat_feature ADD display_on_search BIT";\
\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!\

## Replies

### Reply by AVADHESH PATEL

Hi Ashish!\
For Get [Default](https://www.mindstick.com/interview/12771/what-is-the-importance-of-default-resources) Value Use : SELECT * FROM INFORMATION_SCHEMA.COLUMNS Where ...\
For Set Default Value Use : ALTER TABLE {TABLENAME} ADD {COLUMNNAME} {TYPE} {NULL|NOT NULL} CONSTRAINT {CONSTRAINT_NAME} DEFAULT {DEFAULT_VALUE}\


---

Original Source: https://www.mindstick.com/forum/810/setting-default-value-and-displaying-in-checkboxes

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
