Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How to retrieve culture specific currency and dates

Avatar of gbzhhu
gbzhhuFlag for United Kingdom of Great Britain and Northern Ireland asked on
.NET ProgrammingASP.NETVisual Basic.NET
8 Comments1 Solution815 ViewsLast Modified:
Hi,

I am doing an ASP.NET app that uses satellite assemblies for resources.  Resources work fine so I can change culture from a dropdown and get the correct resource fot hat culture.  However, I cannot get currency and dates working.  I have attached code below

       btnGenError.Text = String.Format("{0:c}", resourceManager.GetString("errorButton", ci))

Always returns £33.22 or 33.22 whichever i put in the resource, no matter what culture is active.  I expected if I set Italian culture to see a Euro sign before currency.  What am I doing wrong?

Thanks
Private Sub LoadResources(ByVal dbFs As DatabaseFunctions)

        Dim culture As String = Me.cboLanguages.SelectedItem.Value
        Dim ci As New CultureInfo(culture)
        Dim resourceManager As ResourceManager

        resourceManager = New ResourceManager("DBT.Extranet.Resources", Assembly.GetExecutingAssembly())

        Thread.CurrentThread.CurrentCulture = ci
        Thread.CurrentThread.CurrentUICulture = ci

        titleText.Text = resourceManager.GetString("welcomeText", ci)
        litAccess.Text = resourceManager.GetString("accesslevel", ci) & " " & dbFs.AccessLevel(0)
        btnGenError.Text = String.Format("{0:c}", resourceManager.GetString("errorButton", ci))

    End Sub