Click here to Skip to main content
16,004,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anybody give me a solution for my problem?

I need to insert all items from html select control to sqlserver in single column, separated by comma.

I have one text box and html select control and I will give values in textbox and move to select control using javascript and give another value in textbox and move to select control.
Like that, I can move any number of items from textbox to select control, and this works fine.

But, now I have to insert all item in select control to sqlserver, not only the selected value, how do I do that?
Posted
Updated 22-May-11 21:37pm
v3
Comments
Dalek Dave 23-May-11 3:38am    
Edited for Grammar, Syntax and Readability.

use like it concatenate all controls values in a single string and save this string value in the column of table.

string str = txtUserName.Text + "," + txtPassword.Text + "," + txtForgot.Text+"and so on";
 
Share this answer
 
v2
Comments
Dalek Dave 23-May-11 3:38am    
Spot on.
As Mohd says, concatenate.

A brief perusal through MS gave me this[^] page that may prove useful.
 
Share this answer
 

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