Iam trying to Calculate The values From 2 Comoboboxes.....But sometimes its calculating and sometimes its Showing BOOLEAN conversion problem... Plz SEE the code .
If C1.Text = "Agra Fort" Andalso C3.Text = "Delhi" Then
l8.Text = 800
ElseIf C1.Text = "agra fort" Andalso C3.Text = "bangalore" Then
l8.Text = 1200
ElseIf C1.Text = "agra fort" Andalso C3.Text = "gaya" Then
l8.Text = 600
ElseIf C1.Text = "agra fort" Andalso C3.Text = "goa" Then
l8.Text = 350
ElseIf C1.Text = "agra fort" Andalso C3.Text = "howrah" Then
l8.Text = 270
End If
Dim child = l8.Text / 2
Dim child2 As Double
child2 = child * Cb3.Text
Dim adult As Double = Cb1.Text * l8.Text
Dim calculate As Double = child2 + adult
Label12.Text = calculate
Label15.Text = child
Dim sw As New IO.StreamWriter("c:/fare.txt")
sw.WriteLine(calculate)
sw.Close()
in child iam making the value half as compared to Amount of Adult fare , then in child2 storing value child{which contains Fare of Per child} multiplying by value entered in combobox{cb3} which can be 1,2,3...etc
Now iam storing the total calculation {adult fare + child fare} in calculate.
after that simply display and store...
Here iam getting Error On boolean conversion .. but some times it is converting...
and its only taking value of 1st expression :
If C1.Text = "Agra Fort" And C3.Text = "Delhi" Then
l8.Text = 800
if i sellect any other expression its not doin any thing...
where am i getting wrong?