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 ...
|
|||||||
|
|||
|
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 |
| Sponsored Links |
|
|||
|
Quote:
Thanks for co-operation but not still written any data insertion part. |
|
|||
|
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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|
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 |