F
Frederik Vanderhaeghe
Hi,
I have a problem converting text to a double. Why doesn't the code work:
If Not (txtdocbedrag.Text = "") Then
Select Case ddlBedrag.SelectedIndex
Case 0
Case 1
whereSQL += "cast(bedrag as numeric(10,2)) > '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 2
whereSQL += "cast(bedrag as numeric(10,2)) >= '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 3
whereSQL += "cast(bedrag as numeric(10,2)) < '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 4
whereSQL += "cast(bedrag as numeric(10,2)) <= '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 5
whereSQL += "cast(bedrag as numeric(10,2)) = '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 6
whereSQL += "cast(bedrag as numeric(10,2)) >= '" &
Double.Parse(txtdocbedrag.Text) & "' cast(bedrag as numeric(10,2)) < '" &
Double.Parse(txtBedragTot.Text) & "' and "
End Select
End If
I have a problem converting text to a double. Why doesn't the code work:
If Not (txtdocbedrag.Text = "") Then
Select Case ddlBedrag.SelectedIndex
Case 0
Case 1
whereSQL += "cast(bedrag as numeric(10,2)) > '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 2
whereSQL += "cast(bedrag as numeric(10,2)) >= '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 3
whereSQL += "cast(bedrag as numeric(10,2)) < '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 4
whereSQL += "cast(bedrag as numeric(10,2)) <= '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 5
whereSQL += "cast(bedrag as numeric(10,2)) = '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Case 6
whereSQL += "cast(bedrag as numeric(10,2)) >= '" &
Double.Parse(txtdocbedrag.Text) & "' cast(bedrag as numeric(10,2)) < '" &
Double.Parse(txtBedragTot.Text) & "' and "
End Select
End If