Click here to Skip to main content
16,013,918 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to store data from Listbox Pin
n_gchaitra31-Jul-07 0:33
n_gchaitra31-Jul-07 0:33 
GeneralRe: How to store data from Listbox Pin
n_gchaitra1-Aug-07 0:46
n_gchaitra1-Aug-07 0:46 
AnswerRe: How to store data from Listbox Pin
koolprasad200330-Jul-07 20:33
professionalkoolprasad200330-Jul-07 20:33 
GeneralRe: How to store data from Listbox Pin
T.EDY30-Jul-07 21:27
T.EDY30-Jul-07 21:27 
GeneralRe: How to store data from Listbox Pin
n_gchaitra31-Jul-07 0:35
n_gchaitra31-Jul-07 0:35 
GeneralRe: How to store data from Listbox Pin
koolprasad200331-Jul-07 1:36
professionalkoolprasad200331-Jul-07 1:36 
GeneralRe: How to store data from Listbox Pin
n_gchaitra31-Jul-07 1:44
n_gchaitra31-Jul-07 1:44 
GeneralRe: How to store data from Listbox Pin
n_gchaitra1-Aug-07 1:24
n_gchaitra1-Aug-07 1:24 
Hi, This function is working, 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: How to store data from Listbox Pin
T.EDY30-Jul-07 21:22
T.EDY30-Jul-07 21:22 
QuestionPlease help me? Pin
v.surendrakumar30-Jul-07 20:07
v.surendrakumar30-Jul-07 20:07 
AnswerRe: Please help me? Pin
Christian Graus30-Jul-07 20:27
protectorChristian Graus30-Jul-07 20:27 
Questionsuggestion Pin
Yulianto.30-Jul-07 19:43
Yulianto.30-Jul-07 19:43 
Questionweb deployment in asp.net 2005 Pin
Sonia Gupta30-Jul-07 19:39
Sonia Gupta30-Jul-07 19:39 
AnswerRe: web deployment in asp.net 2005 Pin
N a v a n e e t h30-Jul-07 20:10
N a v a n e e t h30-Jul-07 20:10 
QuestionrRetaining Data in web form after transfer to another form and back Pin
Sakshi Smriti30-Jul-07 18:58
Sakshi Smriti30-Jul-07 18:58 
AnswerRe: rRetaining Data in web form after transfer to another form and back Pin
Christian Graus30-Jul-07 19:08
protectorChristian Graus30-Jul-07 19:08 
QuestionGridView Issue Pin
Brendan Vogt30-Jul-07 18:50
Brendan Vogt30-Jul-07 18:50 
AnswerRe: GridView Issue Pin
Christian Graus30-Jul-07 19:12
protectorChristian Graus30-Jul-07 19:12 
QuestionLock question [modified] Pin
perrin486930-Jul-07 17:26
perrin486930-Jul-07 17:26 
QuestionGetting data from two tables in a repeater Pin
phoeno2930-Jul-07 17:18
phoeno2930-Jul-07 17:18 
AnswerRe: Getting data from two tables in a repeater Pin
daniel__c30-Jul-07 20:21
daniel__c30-Jul-07 20:21 
GeneralRe: Getting data from two tables in a repeater Pin
phoeno2930-Jul-07 20:40
phoeno2930-Jul-07 20:40 
GeneralRe: Getting data from two tables in a repeater Pin
daniel__c30-Jul-07 20:47
daniel__c30-Jul-07 20:47 
Questionfinding the index of datagrid using the selected item templates Pin
A.Vishal30-Jul-07 15:37
A.Vishal30-Jul-07 15:37 
AnswerRe: finding the index of datagrid using the selected item templates Pin
N a v a n e e t h30-Jul-07 20:06
N a v a n e e t h30-Jul-07 20:06 

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.