Click here to Skip to main content
16,011,608 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionhow can I add dropdown list to DataView and FormView Pin
ksaw12330-Jul-07 20:11
ksaw12330-Jul-07 20:11 
QuestionHow to store data from Listbox Pin
n_gchaitra30-Jul-07 20:10
n_gchaitra30-Jul-07 20:10 
AnswerRe: How to store data from Listbox Pin
Christian Graus30-Jul-07 20:25
protectorChristian Graus30-Jul-07 20:25 
GeneralRe: How to store data from Listbox Pin
n_gchaitra30-Jul-07 20:32
n_gchaitra30-Jul-07 20:32 
AnswerRe: How to store data from Listbox Pin
daniel__c30-Jul-07 20:30
daniel__c30-Jul-07 20:30 
GeneralRe: How to store data from Listbox Pin
n_gchaitra30-Jul-07 20:51
n_gchaitra30-Jul-07 20:51 
GeneralRe: How to store data from Listbox Pin
helelark12330-Jul-07 21:00
helelark12330-Jul-07 21:00 
GeneralRe: How to store data from Listbox Pin
n_gchaitra31-Jul-07 0:33
n_gchaitra31-Jul-07 0:33 
Following is the code i have written, But it is giving the error, ExecuteNonQuery: CommandText property has not been initialized

Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String = ConfigurationSettings.AppSettings("conn")
Dim dbconn As New SqlConnection(constr)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Button1.Attributes.Add("onclick", "return fnMoveItems('ListBox1','ListBox2')")
Button2.Attributes.Add("onclick", "return fnMoveItems('ListBox2','ListBox1')")
End Sub

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim str As String

If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
For Each item As ListItem In ListBox2.Items
str = "insert into a_software (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
End Sub
End Class

Chaitra N

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 
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 

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.