It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Conversion from string "" to type 'Double' is not valid.

Moderator: dafunkymunky

Conversion from string "" to type 'Double' is not valid.

Postby patricks on Wed Feb 16, 2011 8:17 pm

Hello,
I am using a combobox to allow the user to choose what constant he will be using.
Here is the code for the combobox:

Private Sub cboChoosePipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboChoosePipe.SelectedIndexChanged





Select Case cboChoosePipe.Text
Case "HDPE"
Dim ThermalConductivityofCarrierPipe = HDPE
Case "PVC"
Dim ThermalConductivityofCarrierPipe = PVC
Case "ABS"
Dim ThermalConductivityofCarrierPipe = ABS
Case "FRP"
Dim ThermalConductivityofCarrierPipe = FRP
Case "Copper"
Dim ThermalConductivityofCarrierPipe = Copper
Case "Steel"
Dim ThermalConductivityofCarrierPipe = Steel
Case "Ductile Iron"
Dim ThermalConductivityofCarrierPipe = Ductileiron

End Select

End Sub

Now in the click even of my "Ok" button, I added this code :

ThermalConductivityofCarrierPipe = cboChoosePipe.SelectedText.ToString

I set the variable like this:

Public ThermalConductivityofCarrierPipe As Double

Now when ever I run the program I get this error:
Conversion from string "" to type 'Double' is not valid.

How can I make this work?
Thanks!
patricks
 
Posts: 1
Joined: Wed Feb 16, 2011 8:08 pm

Who is online

Users browsing this forum: No registered users and 7 guests