Problem to the line

Hi,
I get this problem
https://dl.dropboxusercontent.com/u/40211031/tt383.png

due to this line

                shop.Add(shopName)

upon that the error happens, I see the value of ShopName is

https://dl.dropboxusercontent.com/u/40211031/tt384.png

why?
LVL 12
HuaMin ChenProblem resolverAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
Always please post the text of error messages. Searches will not be able to find the text of a picture, especially if it is on another site.

In this case, the picture shows something in a far-eastern script, which is no help at all to most of us, so could you try to translate, please? Google has an on-line translator which you might be able to use.
HuaMin ChenProblem resolverAuthor Commented:
Here is the error I've got
輸入字串格式不正確
ste5anSenior DeveloperCommented:
I don't even see any code behind those links..
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

HuaMin ChenProblem resolverAuthor Commented:
I got the error as shown in above.
ste5anSenior DeveloperCommented:
As Graham wrote: Many experts are from the Western world.

Your links only show

Capture.PNG
Graham also asked for a translation.. Well Bing tells me

Capture.PNG
So, when this is a correct translation - I have no clue, if it is - then you need to post your code.
ste5anSenior DeveloperCommented:
Otherwise the answer is simple: Just enter the text input in the correct format.
HuaMin ChenProblem resolverAuthor Commented:
I encounter the problem to last line below
            If (shopcodehold = "" Or shopCode <> shopcodehold) Then
                shop.Add(shopName)
				...

Open in new window

HuaMin ChenProblem resolverAuthor Commented:
I encounter the problem to last line below
    Private shopcodelist As New ArrayList, shop As New ArrayList, weeks As New ArrayList
	...
            If (shopcodehold = "" Or shopCode <> shopcodehold) Then
                shop.Add(shopName)
				...

Open in new window

ste5anSenior DeveloperCommented:
What does shopName contain?

btw, post a concise and complete example. Create a console application which shows this behavior. You will see, that often when creating such an test, that you will find the error on your own. And when not, you have a good starting point for a question.
HuaMin ChenProblem resolverAuthor Commented:
Hi,
I further get the error message with stacktrace like

Conversion from string " " to type 'Double' is not valid.    於 Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)
   於 Microsoft.VisualBasic.CompilerServices.Operators.AddObject(Object Left, Object Right)
   於 KongTaiToolbar.StoreTurnoverCompareReport.CreateReportSheet(Int32 startRowIndex) 於 C:\Kts Projects\KongTai\KongTai Toolbar\KongTaiToolbar\Reports\StoreTurnoverCompareReport.vb: 行 327

due to this line

                    Dim temp2 As Double = Double.Parse(IIf(area2.Value.ToString.Trim = "", 0, area2.Value))

How to resolve this?
ste5anSenior DeveloperCommented:
What was misleading in "post a concise and complete example"?

We cannot tell with out proper samples. Posting single lines is inefficient.

The message says it: area2.Value contains " ". An empty string or a space. Could be a copy'n'paste error by you.

The prolem is that your using an untested user input (never trust user input!) and are doing a forced parse. At least you should do:

Dim temp2 As Double
Dim valueText As String = area2.Value.ToString.Trim
Dim parseResult As Double
Dim canParse As Boolean = Double.TryParse(valueText, canParse)
If canParse Then
    temp2 = parseResult
End If

Open in new window


btw, temp2 is a nonsense name. It requires that you comment the usage of that variable whenever you use it..

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.