By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 2,998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Converting text to double

P: n/a
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
Apr 18 '06 #1
Share this Question
Share on Google+
12 Replies


P: n/a

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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

One thing I spotted is the use of single quote punctuation around a numeric
value (the result of Double.Parse(...).
In your SQL query (that is what you're building, correct?), numeric values
should have no punctuation characters surrounding them. String values need
single quotes, as to dates (in SQL Server. Access date punctuation is the
#.).

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Apr 18 '06 #2

P: n/a
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st)
"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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

Apr 18 '06 #3

P: n/a
but the problem is the "cast(bedrag as numeric(10,2)"
bedrag=databasefield
"Pipo" <Pa****@Mayo.com> wrote in message
news:OR**************@TK2MSFTNGP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st)
"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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


Apr 18 '06 #4

P: n/a
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databasefield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:up**************@TK2MSFTNGP05.phx.gbl...
but the problem is the "cast(bedrag as numeric(10,2)"
bedrag=databasefield
"Pipo" <Pa****@Mayo.com> wrote in message
news:OR**************@TK2MSFTNGP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st)
"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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



Apr 18 '06 #5

P: n/a
bedrag = databasefield is not a syntax it was just saying that it is a field
from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databasefield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:up**************@TK2MSFTNGP05.phx.gbl...
but the problem is the "cast(bedrag as numeric(10,2)"
bedrag=databasefield
"Pipo" <Pa****@Mayo.com> wrote in message
news:OR**************@TK2MSFTNGP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st)
"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
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



Apr 19 '06 #6

P: n/a
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("SomeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databasefield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:up**************@TK2MSFTNGP05.phx.gbl...
but the problem is the "cast(bedrag as numeric(10,2)"
bedrag=databasefield
"Pipo" <Pa****@Mayo.com> wrote in message
news:OR**************@TK2MSFTNGP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st)
"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
> 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
>
>



Apr 19 '06 #7

P: n/a
bedrag is varchar in the database. I have to compare the varchar out of the
database with a value in a textbox, so i convert the varchar to double and i
parse the textbox value to double.
"Pipo" <Pa****@Mayo.com> wrote in message
news:eS**************@TK2MSFTNGP05.phx.gbl...
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("SomeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databasefield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
message news:up**************@TK2MSFTNGP05.phx.gbl...
but the problem is the "cast(bedrag as numeric(10,2)"
bedrag=databasefield
"Pipo" <Pa****@Mayo.com> wrote in message
news:OR**************@TK2MSFTNGP02.phx.gbl...
>I dont know but converting a string to a double does work:
> Dim st As String = "2.0"
> Dim d As Double
> d = Double.Parse(st)
>
>
> "Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
> message news:%2****************@TK2MSFTNGP02.phx.gbl...
>> 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
>>
>>
>
>



Apr 19 '06 #8

P: n/a
Post the exact line, and the value of all variables, that is generating the
error. You can use CDbl too

Jeff
"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
bedrag is varchar in the database. I have to compare the varchar out of
the database with a value in a textbox, so i convert the varchar to double
and i parse the textbox value to double.
"Pipo" <Pa****@Mayo.com> wrote in message
news:eS**************@TK2MSFTNGP05.phx.gbl...
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("SomeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databasefield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
message news:up**************@TK2MSFTNGP05.phx.gbl...
> but the problem is the "cast(bedrag as numeric(10,2)"
> bedrag=databasefield
> "Pipo" <Pa****@Mayo.com> wrote in message
> news:OR**************@TK2MSFTNGP02.phx.gbl...
>>I dont know but converting a string to a double does work:
>> Dim st As String = "2.0"
>> Dim d As Double
>> d = Double.Parse(st)
>>
>>
>> "Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
>> message news:%2****************@TK2MSFTNGP02.phx.gbl...
>>> 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
>>>
>>>
>>
>>
>
>



Apr 19 '06 #9

P: n/a
whereSQL += "cast(bedrag as numeric(10,2)) > '" &
Double.Parse(txtdocbedrag.Text) & "' and "
Bedrag = varchar with a

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP03.phx.gbl... Post the exact line, and the value of all variables, that is generating
the error. You can use CDbl too

Jeff
"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
bedrag is varchar in the database. I have to compare the varchar out of
the database with a value in a textbox, so i convert the varchar to
double and i parse the textbox value to double.
"Pipo" <Pa****@Mayo.com> wrote in message
news:eS**************@TK2MSFTNGP05.phx.gbl...
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("SomeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
message news:%2****************@TK2MSFTNGP05.phx.gbl...
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
> Define "doesn't work". Are you getting an error?
>
> And what kind of syntax is "bedrag=databasefield".
>
> apples=oranges
>
> May I suggest you use some sort of meaningful naming convention?
>
> Jeff
>
> "Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
> message news:up**************@TK2MSFTNGP05.phx.gbl...
>> but the problem is the "cast(bedrag as numeric(10,2)"
>> bedrag=databasefield
>> "Pipo" <Pa****@Mayo.com> wrote in message
>> news:OR**************@TK2MSFTNGP02.phx.gbl...
>>>I dont know but converting a string to a double does work:
>>> Dim st As String = "2.0"
>>> Dim d As Double
>>> d = Double.Parse(st)
>>>
>>>
>>> "Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in
>>> message news:%2****************@TK2MSFTNGP02.phx.gbl...
>>>> 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
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Apr 20 '06 #10

P: n/a
then don't do that (?)

Obviously double.parse is failing. Catch the exception, and debug the
results.

Response.write, instead of issuing the sql (duh)

txtdocbedrag.text contains text you don't expect. Find out why

I find it amazing, and almost sad, the programmers these days can't figure
out reproducible problems.

I'm 50. I had issues like this 25 years ago, but before newgroups, granted.

Just my opinion

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
whereSQL += "cast(bedrag as numeric(10,2)) > '" &
Double.Parse(txtdocbedrag.Text) & "' and "


Bedrag = varchar with a

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP03.phx.gbl...
Post the exact line, and the value of all variables, that is generating
the error. You can use CDbl too

Apr 20 '06 #11

P: n/a
It's not the double.parse that is failing, its the convert in sql!

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:uq**************@TK2MSFTNGP03.phx.gbl...
then don't do that (?)

Obviously double.parse is failing. Catch the exception, and debug the
results.

Response.write, instead of issuing the sql (duh)

txtdocbedrag.text contains text you don't expect. Find out why

I find it amazing, and almost sad, the programmers these days can't figure
out reproducible problems.

I'm 50. I had issues like this 25 years ago, but before newgroups,
granted.

Just my opinion

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
whereSQL += "cast(bedrag as numeric(10,2)) > '" &
Double.Parse(txtdocbedrag.Text) & "' and "


Bedrag = varchar with a

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP03.phx.gbl...
Post the exact line, and the value of all variables, that is generating
the error. You can use CDbl too


Apr 21 '06 #12

P: n/a
Please show the resultant SQL

response.write strSQL

but don't actually execute it.

Jeff

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:Of**************@TK2MSFTNGP02.phx.gbl...
It's not the double.parse that is failing, its the convert in sql!

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:uq**************@TK2MSFTNGP03.phx.gbl...
then don't do that (?)

Obviously double.parse is failing. Catch the exception, and debug the
results.

Response.write, instead of issuing the sql (duh)

txtdocbedrag.text contains text you don't expect. Find out why

I find it amazing, and almost sad, the programmers these days can't
figure out reproducible problems.

I'm 50. I had issues like this 25 years ago, but before newgroups,
granted.

Just my opinion

"Frederik Vanderhaeghe" <fr******************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
whereSQL += "cast(bedrag as numeric(10,2)) > '" &
Double.Parse(txtdocbedrag.Text) & "' and "

Bedrag = varchar with a

"Jeff Dillon" <je********@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP03.phx.gbl...
Post the exact line, and the value of all variables, that is generating
the error. You can use CDbl too



Apr 21 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.