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

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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> 在郵件
news:ue**************@TK2MSFTNGP10.phx.gbl 中撰寫...
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

P: n/a
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> 在郵件
news:ue**************@TK2MSFTNGP10.phx.gbl 中撰寫...
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

P: n/a
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> 在郵件
news:Op**************@TK2MSFTNGP14.phx.gbl 中撰寫...
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> 在郵件
news:ue**************@TK2MSFTNGP10.phx.gbl 中撰寫...
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 discussion thread is closed

Replies have been disabled for this discussion.