AS400 + VB.NET and Regional Setting

G

Guest

Hi,

We have and IBM AS400 and I belive the reional setting is Turkish. The IBM
Client-Access for Windows that install in our PC (WIN XP SP2) set to Turkish
characters.

Now my PC has English (US) regional setting and I am not having any problem
to connect.

But If I change my PC Regional setting to Turkish all of my VB.NET code is
not working. Data that comes from AS400 either not recognizable or very
unusal.

Example the decimal variable in PC Regional Setting (English-US) would be
15,97.50
But if my PC Regional Setting set to Turkish than value become as: 15.975.050

Does anyone knows what is happening or how can I set the right coding in
VB.NET even if my PC has Turkish Reginal Setting?

I thank you for your kind understanding to reading my post.

Rgds,
GC
 
C

Cor Ligthert [MVP]

Niyazi,

I don't know if I have an answer however an important part of your question
is at least for my confusing.
Example the decimal variable in PC Regional Setting (English-US) would be
15,97.50
But if my PC Regional Setting set to Turkish than value become as:
15.975.050

15,97.50 is not an representation of a value using the English language
style. Therefore cah you evaluate what is wrong in probably both
representations that you give.

Cor
 
G

Guest

Hi Cor,

The Regional Setting odf the English US number value is:
123,456,789.00

And if the Regional Setting is the Turkish than the number value is:
123.456.789,00

------------------------------------------------------------------------------------------

If my Regional Setting is English Us than my data value that comes from IBM
AS400 is: 369.103

And if my Regional Setting Turkish than my data value that comes from IBM
AS400 is: 36.910.331

The right value is 369.103 (3 Hundred Sixty nine thousand ...)

But in Turkisg Regional setting this comes as 36.910.331 (Thirty six million
.....)

I have no idea why the value will be representing itself such a way that has
a huge differences.

Cor, I thank you in advance to helping me out.

Rgds,
GC
 
C

Cor Ligthert [MVP]

Niyazi,

I assume that the AS400 is using EBCDIC and that it is translated using a
translation filter to ASCCI. I as well assume that what is given is in a
string format.
The right value is 369.103 (3 Hundred Sixty nine thousand ...)

This is not the right value in the English format, in the english format
what is 369,103 in our format.

Therefore I assume that is given to your process something as "369103,31"
the way that you translate this makes in my opinion why you get those
strange values. Can you show that to us?

Cor
 
G

Guest

Hi Cor,

You are right about it In the data row my value looks as you wrote above
("369103,31" ) And when my application try to send the data in to the EXCEL
sheet
than value is shown as wrote before.

The data that comes from the AS400 (and If my PC Regional setting is
Turkish) as you show it: ("369103,31" )

I have no idea that AS400 is using EBCDIC. How can I over come this problem?

I thank you in advance to helping me out.

Rgds,
GC
 
C

Cor Ligthert [MVP]

Niyazi,

I think that in your case it is the most simple to replace the comma by a
dot.

str = str.replace(",",".")
And than use the
dim myDouble as double = Double.Parse (str, CultureInfo.InvariantCulture)


I hope this helps,

Cor
 
G

Guest

Hi Cor,

Thank you for info. I did use the String replace method. But I am having one
of the table that reside in AS400 (the Currency Table).

I wrote my previous post but the real error was the when the time I was
trying to filling the dataset and if my PC Regional setting was Turkish than
I am getting error. Error was:

"The data value could not be converted for reasons other than sign mismatch
or data overflow. For example, the data was corrupted in the data store but
the row was still retrievable."

First was I created Windows services and the data will be transfered from
AS400 to SQL Server every 10 minute. Than later my boss set that I should put
extra menu button so user also can transfer the data manulay.

In the same code will work on Windows Services and didn't worked manually.

Than later I find the data was un regognizable due to Regional Setting.
Now I fixed the one the application using String Replace method, but I am
still having problem one application typicaly filling the dataset. Most of
the my application that have acces to AS400 works but the on the one table I
am having real problem and strangely my program works with Windows services
and doesn't work manualy!!!

Any suggestion or idea what might happened. I am more than happy to provide
the code as well.

Cor, I thank you for your kind help.

Rgds,
GC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top