Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all
plz help me

how to add multiple name of my friends in one column of SQL table using asp.net web form.
(that has two textbox UserId and friend name)

Like this

UserID Friend List
R001 Ajay,Sanjeev,kamal,Sachin,karan,Pawan
R002 Karan,balbinder,sachin,kiran,sonam
Posted

1 solution

Hi,

You can make something like this:

Insert Into FriendList(UserId, FriendName) Values ('R001','Ajay,Sanjeev,kamal,Sachin,karan,Pawan')


Insert Into FriendList(UserId, FriendName) Values ('R002','Karan,balbinder,sachin,kiran,sonam')

Are you sure you want to do this ?
 
Share this answer
 
Comments
BALBINDER4u 1-Mar-13 6:25am    
NO.....

NAME ADD ONE BY ONE
I mean fisrt add karan then add balbinder then..................
José Amílcar Casimiro 1-Mar-13 6:45am    
Except for the first time (must have an insert statement), you can concatenate the names this way:

Update FriendList
Set FriendName = FriendName + ',' + 'balbinder'
Where UserId = 'R001'

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