Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdownlist problem

Status
Not open for further replies.

russellmunday

Technical User
Jul 24, 2003
87
GB
The dropdown lists are named
Divisionddl
Kitddl


Private Sub kitddl_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kitddl.SelectedIndexChanged
' code here shows the visual in the picture box and sets the price
Image1.ImageUrl = ("c: \" & kitddl.SelectedItem.Text & "visual.jpg")

Select Case kitddl.SelectedItem.Text
Case "GBCE006", "GBSM007", "GBSMT007"
pricelbl.Text = "888.00"
Case "GBSM008", "GBSMT008", "GBCE007"
pricelbl.Text = "789.00"
Case "GBCE008", "GBSM010", "GBSMT010", "GBSM009", "GBSMT009"
pricelbl.Text = "99.00"
Case "GBCE001", "GBSM002", "GBSMT002", "GBCE002", "GBSM001", "GBSMT001"
pricelbl.Text = "980.00"
Case "GBSM004", "GBSMT004"
pricelbl.Text = "2000.00"
Case "GBSM003", "GBSMT003", "GBCE003"
pricelbl.Text = "800.00"
Case "GBSM005", "GBSMT005", "GBCE004", "GBCE005", "GBSM006", "GBSMT006"
pricelbl.Text = "500.00"

End Select

The picture displayes fine but the pricebl does not
The second part of the below writes the information to a table the problem is that only the first character is written to the kit column.

Private Sub confirmcmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles confirmcmd.Click
' code to validate form and send information to conformation page
Call wnum() ‘ writes a number to a dat file for later use


'save information to database
Dim strkit As String = kitddl.SelectedItem.Text
SqlCmd1.Parameters("@qty").Value = qtytxt.Text
SqlCmd1.Parameters("@name").Value = nametxt.Text
SqlCmd1.Parameters("@address").Value = addrtxt.Text
SqlCmd1.Parameters("@email").Value = mail1txt.Text
SqlCmd1.Parameters("@kit").Value = LBLRUS.Text 'kitddl.SelectedItem.Text
SqlCmd1.Parameters("@price").Value = pricelbl.Text
SqlConnection1.Close()

SqlConnection1.Open()
SqlCmd1.ExecuteNonQuery()
SqlConnection1.Close()

Response.Redirect("confirm.aspx")


End Sub


 
I have managed to sort out the second part of this problem by deleting the sqlcommand and readding it by dragging the stored procedure to the form.
But the price label still does not work
how ever if i use selecteditem.value it works unfortunatly I can not use it here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top