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

decimal separator, regional settings

P: n/a
pax

Hello there!

Here is my problem, in the simplest scenario:
- an Access 2000 format database (created with Access 2003)
- a simple table that contains one single field defined as Number, Decimal,
18,2
- VS2005 standard, C#
- a data source / dataset that cotains that simple Access table
- a DataGridView, created by drag and drop, with all the helper objects
(adapter, navigator etc) that edits that simple table
- WinXPSP2 with ***Regional Options in Control Panel set to
Romanian*** , with no other customization

And here's the problem: what magic do I have to do to enter decimal numbers
in that grid and save them in the database? Because as long as I type in
1,23 (given that the decimal separator in Romanian Regional Options is the
comma), the grid displays it correctly, I can save it to the daabase, but
when I reload the data by reopening the form, my number is 123 (and it
really IS 123 in the database!).

Thanks in advance.
pax

May 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
pax

Here are some other details:
- The database is local, it resides on the computer that the app is running
on.
- I first encountered this problem on user's computer, then I was able to
reproduce it on my machine by changing the regional settings to Romanian.
- I upgraded the database to the 2003 format, the problem persists. So it's
not that.
- I used some other control to edit the data, i.e. a simple textbox, still
the same, so it's not datagridview's fault.
- I created the same dummy table on SQL, then used another dataset, the
problem's gone, so it is related somehow to Access!
- used the:
Thread.CurrentThread.CurrentCulture = new CultureInfo("ro-RO");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("ro-RO");
(and also with 'false' as a second parameter, useUserOverride), of no
avail. The funny thing here is that on a machine with EN-US regional
settings and the above two lines in place, everything works fine!
- tried to set the Locale Identifier property on the connectionstring to
1048 (RO), no news.

So that's pretty much it, I'm out of any ideas...

Any help much appreciated.
Thanks a lot.
Pax

"pax" <pa*@noname.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>
Hello there!

Here is my problem, in the simplest scenario:
- an Access 2000 format database (created with Access 2003)
- a simple table that contains one single field defined as Number,
Decimal,
18,2
- VS2005 standard, C#
- a data source / dataset that cotains that simple Access table
- a DataGridView, created by drag and drop, with all the helper objects
(adapter, navigator etc) that edits that simple table
- WinXPSP2 with ***Regional Options in Control Panel set to
Romanian*** , with no other customization

And here's the problem: what magic do I have to do to enter decimal
numbers
in that grid and save them in the database? Because as long as I type in
1,23 (given that the decimal separator in Romanian Regional Options is the
comma), the grid displays it correctly, I can save it to the daabase, but
when I reload the data by reopening the form, my number is 123 (and it
really IS 123 in the database!).

Thanks in advance.
pax

May 27 '07 #2

P: n/a
pax

"pax" <pa*@noname.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>
Hello there!

Here is my problem, in the simplest scenario:
- an Access 2000 format database (created with Access 2003)
- a simple table that contains one single field defined as Number,
Decimal,
18,2
- VS2005 standard, C#
- a data source / dataset that cotains that simple Access table
- a DataGridView, created by drag and drop, with all the helper objects
(adapter, navigator etc) that edits that simple table
- WinXPSP2 with ***Regional Options in Control Panel set to
Romanian*** , with no other customization

And here's the problem: what magic do I have to do to enter decimal
numbers
in that grid and save them in the database? Because as long as I type in
1,23 (given that the decimal separator in Romanian Regional Options is the
comma), the grid displays it correctly, I can save it to the daabase, but
when I reload the data by reopening the form, my number is 123 (and it
really IS 123 in the database!).

Thanks in advance.
pax

May 28 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.