.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

insert check box to database

Posted By: kokulakrishnan     Posted Date: January 13, 2011    Points:2   Category :ASP.Net
how to insert check box value in to database table's column.eg: if checked or unchecked.

advance thanx to all

Responses
Author: Manas Patnaik             
Posted Date: January 14, 2011     Points: 5   

Use "bit" Field type .

Manas Patnaik
http://manaspatnaik.com/blog
Author: Syed Shakeer Hussain             
Posted Date: January 15, 2011     Points: 5   

Hi,
To Insert CheckBox items in a Table,First create a column with a BIT dataType.

Now in C# :
int a;
if(CheckBoxMale.Checked)
{
a=1;
}
else
{
a=0;
}

Inserting checked Item value in a table

Insert into TableName(columnName) Values(a)




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend