C#,MS Access应用程序的区域设置开关 [英] C#, Regional Setting switch on MS Access Application

查看:90
本文介绍了C#,MS Access应用程序的区域设置开关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,

我对区域设置有一个安静的问题...希望有人知道答案。



我有MS Access数据库,并且有一个从SharePoint链接的表。

我正在使用英国区域设置,并且SharePoint使用德语区域设置进行设置。

当我打开数据库并打开它时,表中的数字应该是它的100倍。

原因是因为。英国的(点)用于数字分组(单独数千)和。 (点)在德国用于小数位...

所以 - 德国10.11(十点十一)是1011(一千零一十一)在英国。

我尝试使用CultureInfo在单独的线程中启动MS访问,但没有区别。

Hello Everyone,
I have quiet delicate problem with regional settings... hope somebody knows the answer.

I have MS Access database and there is a table linked from SharePoint.
I am using UK regional settings and that SharePoint is set with German regional settings.
When I open the DB and open that table numbers in it are 100 times greater then it should be.
The reason for this is because "." (dot) in UK is used for digital grouping (separate thousands) and "." (dot) in Germany is used for decimal places...
So - German 10.11 (Ten point eleven) is 1011 (One thousand and eleven) in UK.
I have tried starting MS access in separate thread using CultureInfo, but that made no difference.

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");




Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");

如果我启动MessageBox - 它显示在我使用CultureInfo设置的正确区域设置中,但是当我启动应用程序(Access,Excel等) - 它在原始用户设置中打开...

有没有人知道用某种方式用C#更改用户区域设置的方式?br />


PS:我知道不建议练习,但有时我们必须做我们必须做的事。



谢谢大家!

If I start the MessageBox - it shows in correct regional settings as I set with CultureInfo, but when I start the application (Access, Excel, etc.) - it opens in the original user settings...
Does anyone know a way ho to change user''s regional settings with C# somehow?

P.S.: I know that it''s not recommended practice, but sometime we have to do what we have to.

Thanks everyone!

推荐答案

谢谢你回复Jegan,但这不可能改变SharePoint。我们必须使用我们拥有的东西。另外,保留数字的列是单行文本的类型,这意味着每次我们获取数据时 - 我们将其转换为双值。

我试图强制SharePoint管理员移动他的屁股并解决它,但是....我不是那个在这里做主的人,仍然需要使用它。

到目前为止,唯一的解决办法是直接更改用户区域设置......我只是不知道如何:)



再次感谢大家!
Thanks for the reply Jegan, but this is not possible to alter SharePoint. We have to use what we have. Also that column, holding the numbers, is type of "Single line of text" meaning that each time we take the data - we typecast it into double value.
I was trying to force SharePoint admin to "move his ass and fix it", but.... I am hardly the one who calls the shots here and still have to work with it.
So far the only solution to this I could fing was to change user regional settings directly... and I just don''t know how :)

Thanks again guys!


这篇关于C#,MS Access应用程序的区域设置开关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆