Exforsys

Free Training

Inserting checkbox values into one field

This is a discussion on Inserting checkbox values into one field within the Microsoft .NET forums, part of the Programming Talk category; Hi I have a checkboxes on my page (.aspx) like checkbox1 - item1 checkbox2 - item2 checkbox3 - item3 etc ...

Go Back   Exforsys > Programming Talk > Microsoft .NET

Exforsys.com

  #1 (permalink)  
Old 06-06-2009, 03:48 AM
Junior Member
 
Join Date: Jun 2009
Posts: 2
nicky123 is on a distinguished road
Inserting checkbox values into one field

Hi

I have a checkboxes on my page (.aspx) like

checkbox1 - item1
checkbox2 - item2
checkbox3 - item3
etc

what i want is that when a user selects certain checkboxes
they should be inserted into a table called
customer which has fields (customer id and actions)

the data should be inserted as

customerid actions
1 item1,item2,item3
2 item1,item3
3 etc..

i.e all the values should be inserted into database into one field separated by commas.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-08-2009, 06:05 AM
Junior Member
 
Join Date: Jun 2009
Posts: 1
Avantha is on a distinguished road
Have u written any data insertion part..? I mean in SQL or something?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-08-2009, 07:03 AM
Junior Member
 
Join Date: Jun 2009
Posts: 2
nicky123 is on a distinguished road
Quote:
Originally Posted by Avantha View Post
Have u written any data insertion part..? I mean in SQL or something?
Hello Avanth,
Thanks for co-operation but not still written any data insertion part.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-13-2009, 03:06 AM
Junior Member
 
Join Date: Jul 2009
Posts: 1
anandfuns is on a distinguished road
hi,

I can help u out but i need need sum clarifications.. If my understanding is correct then its merely database table updations.. If I know the employee id of the users.. then i can use the select statement to search the table entry n read the action column value from the matching record.. then append it with the corresponding item.. finally use the update query to make the updation back to the database table..

sqlconnection con = new connection("give the connection string here");
sqlcommand cmdSelect = new sqlcommand("select action from customer where custid= "+ cust_id,con);// cust_id is the id of the corresponding user
if(cmdSelect.executescalar() != string.empty)
{
sqlcommand cmdUpdate = new sqlcommand("udate customer set action = action" + "," + item + " where custid = "+cust_id,con);
cmdUpdate.executeNonQuery();

}

Note:
The keyword casing is not properly given..


with Regards,
Anand Kumar .I
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
QTP Material kalyansantosh Software Testing 7 12-29-2009 01:10 PM
Data security/filtering on field values Guy Software Patterns 1 05-19-2005 12:16 PM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-15-2004 06:00 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 06:00 AM
[FAQ] FileMaker Pro - database for Macintosh and Windows Martin Trautmann Tech FAQ 0 04-17-2004 07:26 AM


All times are GMT -4. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.