Click here to Skip to main content
15,890,438 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Disabling the browser back button Pin
Blue_Boy1-Aug-07 4:26
Blue_Boy1-Aug-07 4:26 
GeneralRe: Disabling the browser back button Pin
Mr.Sam1-Aug-07 4:30
Mr.Sam1-Aug-07 4:30 
GeneralRe: Disabling the browser back button Pin
Blue_Boy1-Aug-07 4:35
Blue_Boy1-Aug-07 4:35 
GeneralRe: Disabling the browser back button Pin
Mr.Sam1-Aug-07 5:15
Mr.Sam1-Aug-07 5:15 
AnswerRe: Disabling the browser back button Pin
Abisodun1-Aug-07 6:51
Abisodun1-Aug-07 6:51 
QuestionSession Timeout problem Pin
koolprasad20031-Aug-07 2:51
professionalkoolprasad20031-Aug-07 2:51 
AnswerRe: Session Timeout problem Pin
Fred_Smith1-Aug-07 4:17
Fred_Smith1-Aug-07 4:17 
Questionappend the listitems as a comma seperated string Pin
n_gchaitra1-Aug-07 2:15
n_gchaitra1-Aug-07 2:15 
how to append the listitems as a comma seperated string and insert into the database in a single row using asp.net 2.0 I am using vb. I am copying a content of listbox1 to listbox2. I want to store the listbox2 data into database. I am using the following code, But the each value is getting stored in different row of the table. I want them to get stored in a single row.

Dim str As String
If dbconn.State ConnectionState.Open Then
dbconn.Open()
End If
For Each item As ListItem In lstselectedemployees.Items
str = "insert into a (soft)values('" & item.Text & "')"
Dim comm As New SqlCommand(str, dbconn)
Try
comm.ExecuteNonQuery()
Label1.ForeColor = Drawing.Color.Green
Label1.Text = "Success"
Catch ex As Exception
Label1.Text = ex.Message
End Try
Next

If I use the following code then, only the last item of the list box is getting stored,

Dim str As String
If dbconn.State ConnectionState.Open Then
dbconn.Open()
End If
For Each item As ListItem In lstselectedemployees.Items
str = "insert into a (soft)values('" & item.Text & "')"
Next
Dim comm As New SqlCommand(str, dbconn)
Try
comm.ExecuteNonQuery()
Label1.ForeColor = Drawing.Color.Green
Label1.Text = "Success"
Catch ex As Exception
Label1.Text = ex.Message
End Try


Chaitra N

AnswerRe: append the listitems as a comma seperated string Pin
jc.net1-Aug-07 2:27
jc.net1-Aug-07 2:27 
GeneralRe: append the listitems as a comma seperated string Pin
n_gchaitra1-Aug-07 2:51
n_gchaitra1-Aug-07 2:51 
GeneralRe: append the listitems as a comma seperated string Pin
Malcolm Smart1-Aug-07 3:05
Malcolm Smart1-Aug-07 3:05 
GeneralRe: append the listitems as a comma seperated string Pin
BasharatAli1-Aug-07 3:06
BasharatAli1-Aug-07 3:06 
GeneralRe: append the listitems as a comma seperated string Pin
n_gchaitra1-Aug-07 3:33
n_gchaitra1-Aug-07 3:33 
GeneralRe: append the listitems as a comma seperated string Pin
jc.net1-Aug-07 3:08
jc.net1-Aug-07 3:08 
GeneralRe: append the listitems as a comma seperated string Pin
n_gchaitra1-Aug-07 3:36
n_gchaitra1-Aug-07 3:36 
GeneralRe: append the listitems as a comma seperated string Pin
n_gchaitra2-Aug-07 21:28
n_gchaitra2-Aug-07 21:28 
AnswerRe: append the listitems as a comma seperated string Pin
Nand Kumar Das1-Aug-07 3:07
Nand Kumar Das1-Aug-07 3:07 
GeneralRe: append the listitems as a comma seperated string Pin
n_gchaitra2-Aug-07 22:09
n_gchaitra2-Aug-07 22:09 
AnswerRe: append the listitems as a comma seperated string Pin
#realJSOP1-Aug-07 3:24
mve#realJSOP1-Aug-07 3:24 
GeneralRe: append the listitems as a comma seperated string Pin
jc.net1-Aug-07 3:40
jc.net1-Aug-07 3:40 
QuestionConverting code Pin
SirNathaniel1-Aug-07 2:03
SirNathaniel1-Aug-07 2:03 
AnswerRe: Converting code Pin
BasharatAli1-Aug-07 2:18
BasharatAli1-Aug-07 2:18 
GeneralRe: Converting code Pin
SirNathaniel1-Aug-07 6:53
SirNathaniel1-Aug-07 6:53 
AnswerRe: Converting code Pin
Dave Doknjas1-Aug-07 14:04
Dave Doknjas1-Aug-07 14:04 
QuestionCannot open any more Tables Pin
Khan.Bangash1-Aug-07 1:15
Khan.Bangash1-Aug-07 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.