473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

case type from string '' to type 'double' is invalid

It is very strange ~~ my tab control got Page1 & Page2, there is combox box
in Page2,
in combox 's selectedindexchanged ,
For Each drInvChg In drInvInfo.GetChildRows("fk_invno")
drInvChg.Item("exrate") = 1.0 <-- problem ??
end for
Problem, when the form load , user click page2, THE above error will be
happend, I don't know what's wrong if it.
If I omit that line, eveyrthing goes fine. ??
Please help ~~~
Nov 21 '05 #1
4 1091
Hi,

If drInvChg.Item("exrate") is expecting a string then do this:

drInvChg.Item("exrate") = "1.0"

Or if (drInvChg.Item() takes an integer for an argument instead of a string
(i.e. "exrate") then you'll need to supply an integer. Right now my guess
is the 2nd one because you can assign 1.0 to a string variable, but the
string will contain "1" instead of "1.0". Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
It is very strange ~~ my tab control got Page1 & Page2, there is combox box in Page2,
in combox 's selectedindexchanged ,
For Each drInvChg In drInvInfo.GetChildRows("fk_invno")
drInvChg.Item("exrate") = 1.0 <-- problem ??
end for
Problem, when the form load , user click page2, THE above error will be
happend, I don't know what's wrong if it.
If I omit that line, eveyrthing goes fine. ??
Please help ~~~

Nov 21 '05 #2
drInvChg.item("exrate") is the exchange rate , it must be decmial , not a
string. I am wonder why there is an error
"Ken Dopierala Jr." <kd*********@wi.rr.com> ¦b¶l¥ó
news:ue**************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
Hi,

If drInvChg.Item("exrate") is expecting a string then do this:

drInvChg.Item("exrate") = "1.0"

Or if (drInvChg.Item() takes an integer for an argument instead of a string (i.e. "exrate") then you'll need to supply an integer. Right now my guess
is the 2nd one because you can assign 1.0 to a string variable, but the
string will contain "1" instead of "1.0". Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
It is very strange ~~ my tab control got Page1 & Page2, there is combox

box
in Page2,
in combox 's selectedindexchanged ,
For Each drInvChg In drInvInfo.GetChildRows("fk_invno")
drInvChg.Item("exrate") = 1.0 <-- problem ??
end for
Problem, when the form load , user click page2, THE above error will be
happend, I don't know what's wrong if it.
If I omit that line, eveyrthing goes fine. ??
Please help ~~~


Nov 21 '05 #3
Hi,

Could you post more code. What is drInvChg? A datarow? Also what is
drInvInfo? What type of objects are these? I would put a breakpoint on
your For Each line. Then highlight drInvChg.Item("exrate") and put it in
your watch window. What type of value does it return? A String? You are
getting this error because one of your values is a string that can not be
converted to a double data type. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:uz*************@TK2MSFTNGP12.phx.gbl...
drInvChg.item("exrate") is the exchange rate , it must be decmial , not a
string. I am wonder why there is an error
"Ken Dopierala Jr." <kd*********@wi.rr.com> ¦b¶l¥ó
news:ue**************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
Hi,

If drInvChg.Item("exrate") is expecting a string then do this:

drInvChg.Item("exrate") = "1.0"

Or if (drInvChg.Item() takes an integer for an argument instead of a

string
(i.e. "exrate") then you'll need to supply an integer. Right now my guess is the 2nd one because you can assign 1.0 to a string variable, but the
string will contain "1" instead of "1.0". Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
It is very strange ~~ my tab control got Page1 & Page2, there is combox
box
in Page2,
in combox 's selectedindexchanged ,
For Each drInvChg In drInvInfo.GetChildRows("fk_invno")
drInvChg.Item("exrate") = 1.0 <-- problem ??
end for
Problem, when the form load , user click page2, THE above error will

be happend, I don't know what's wrong if it.
If I omit that line, eveyrthing goes fine. ??
Please help ~~~



Nov 21 '05 #4
I know where is my bug , the problem is not the dgInvCharges, the problem
belongs to the dataTable,
In my DataTable 's columnChanged and I solve it , Thanks for your kind
attention.
"Ken Dopierala Jr." <kd*********@wi.rr.com> ¦b¶l¥ó
news:Op**************@TK2MSFTNGP14.phx.gbl ¤¤¼¶¼g...
Hi,

Could you post more code. What is drInvChg? A datarow? Also what is
drInvInfo? What type of objects are these? I would put a breakpoint on
your For Each line. Then highlight drInvChg.Item("exrate") and put it in
your watch window. What type of value does it return? A String? You are
getting this error because one of your values is a string that can not be
converted to a double data type. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:uz*************@TK2MSFTNGP12.phx.gbl...
drInvChg.item("exrate") is the exchange rate , it must be decmial , not a
string. I am wonder why there is an error
"Ken Dopierala Jr." <kd*********@wi.rr.com> ¦b¶l¥ó
news:ue**************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
Hi,

If drInvChg.Item("exrate") is expecting a string then do this:

drInvChg.Item("exrate") = "1.0"

Or if (drInvChg.Item() takes an integer for an argument instead of a

string
(i.e. "exrate") then you'll need to supply an integer. Right now my

guess is the 2nd one because you can assign 1.0 to a string variable, but the string will contain "1" instead of "1.0". Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
> It is very strange ~~ my tab control got Page1 & Page2, there is combox box
> in Page2,
> in combox 's selectedindexchanged ,
> For Each drInvChg In drInvInfo.GetChildRows("fk_invno")
> drInvChg.Item("exrate") = 1.0 <-- problem ??
> end for
> Problem, when the form load , user click page2, THE above error will be > happend, I don't know what's wrong if it.
> If I omit that line, eveyrthing goes fine. ??
> Please help ~~~
>
>



Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Terencetrent | last post by:
I having been using Access '97/2002 for about 4 years now and have never really had the need or the time to learn visual basic. Well, I think the time has finally come. I need help with Visual...
6
by: Sreekanth | last post by:
Hello, Am trying to convert a string to float. Am using atof() for that purpose. But the return value for atof is same for the string "0.0" and for some invalid input "Invalid". Can any body...
7
by: zjut | last post by:
I need to implement the method : round(String name, int index) The given string maybe the every type of float type, ( the msdn given the regax is that : integral-digits]exponential-digits]) ...
59
by: Michael C | last post by:
eg void DoIt() { int i = FromString("1"); double d = FromString("1.1"); } int FromString(string SomeValue) {
10
by: April | last post by:
Hope someone can help me The SQL string i need to use does not work, Who can help me.... Thanks in advance Dim strConn As String Dim strSQL As String
16
by: Martin Jørgensen | last post by:
Hi, Short question: Any particular reason for why I'm getting a warning here: (cast from function call of type int to non-matching type double) xdouble = (double)rand()/(double)RAND_MAX;
21
by: Lane Straatman | last post by:
#include <stdio.h> #include <stdlib.h> #include <complex.h> int main(void) { _Complex z1, z2, z3; z1 = .4 + .7i; z2 = pow(z1, 2); z3 = z1 * z1; printf("%f, %f \n", z1);
9
by: weirdwoolly | last post by:
Hopefully someone will be able to help. I have written a stored procedure in C++ called from a Java test harness to validate the graphic data types in C++ and their use. I have declared the...
1
by: eshortt84 | last post by:
hey, i'm new to java and i keep getting the return type required error on this line; public dvds(int productNum, String name, int units, double price, String rating) { The code for the whole...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.