Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to insert checkboxes selected value which are filled through database connection in to sqlserver table.technology is ASP.NET

please suggest the code for it
Posted
Updated 4-Sep-12 7:17am
v2
Comments
[no name] 4-Sep-12 13:34pm    
Personally, I would suggest using SQL but that is just me.

hello use this thread!

1.store the column value as bit
2.get it in datatable

<asp:CheckBox ID="isUploadedCheckBox" runat="server"
Checked='<%# Bind("IsUploaded") %>' />

regards,
Karthik.J
 
Share this answer
 
v2
Steps:
1. In your table, define a BIT field to store the checkbox value (if it's a single value, row based) OR define a varchar field to store multiple values in form of 0 or 1 comma separated.
2. From frontend, pass on your selection(s) to Database via ADO.NET
3. Create an INSERT query that inserts the value of checkbox as true/false (1/0) in the database.

Try out! Post specific issue if you face any!
 
Share this answer
 
Hi,

you have keep one BIT field. Which stores the value that checkbox is checked or not. If you want to add multiple checkbox value then use nvarchar and save comma seperated values.

See the below link. It might be help you.

http://www.c-sharpcorner.com/Blogs/9444/insert-checkbox-values-into-database.aspx[^]

http://www.thinkdigit.com/forum/programming/139740-how-store-multiple-values-checkboxlist-asp-net.html[^]

How to store checkboxlist value?[^]

Thanks,
Viprat
 
Share this answer
 
Comments
shafna jasmin 5-Sep-12 0:58am    
why we are doing asp.net projects
[no name] 5-Sep-12 7:05am    
I think you are alright!
VIPR@T 5-Sep-12 1:06am    
i am getting you.. what you mean to say.. plz explain.
VIPR@T 5-Sep-12 7:11am    
ok.. Thanks...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900