Change Oracle session to accept number with comma and point in C #

3

When opening an oracle connection in C# , I need the . and , to behave according to the 0.000,00 rule in a real number. I would like to know how do I change this format in open session in OracleConnection

    
asked by anonymous 10.04.2014 / 20:08

2 answers

1

According to this article in the original SO, there are several answers that can elucidate your problem: how- to-format-oraclenumber-generically

Here's one I liked:

alter session set NLS_NUMERIC_CHARACTERS='.,'
alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS'
    
10.04.2014 / 20:23
0

To be in the format pt-BR and this is reflected in the other configurations, mainly in the regional ones use:

  

Windows Form: Desktop Application

System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("pt-BR")
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("pt-BR")
  

Web: Forms or MVC Web Application

<system.web>
    <globalization uiCulture="pt-BR" culture="pt-BR"/>
</system.web>

With these settings it will configure your application with a regional behavior, being very important because, you do not need to interfere in these conversions that are done automatically. I have Web applications running on servers outside of Brazil and this is of the utmost importance.

    
10.04.2014 / 21:59