weird behaviuor when assigning string

Discussion in 'ASP.NET / ASP.NET Core' started by androoo, Nov 11, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi
    I have some strange behaviour that im looking for ideas on:

    GetCountryCode returns a string from a stored procedure, standard stuff

    strCult = Trim(ca.GetCountryCode(Userid))
    ci = New CultureInfo(Trim(strCult))
    Thread.CurrentThread.CurrentCulture = ci

    if i debug in the environment the output of GetCountryCode is:
    "sv-SE
    "

    Note the carridge return (maybe this is irrelevent)
    If I set the same code manually it works:
    ci = New CultureInfo("sv-SE")
    Thread.CurrentThread.CurrentCulture = ci

    Is there something basic im missing here that I cant see, there are other ways around this but I would be really intrested to know what im doing wrong when assigning this string
    Any help appreciated
    Andy
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    well, you may have a CR in the database value. You can try sterilize the string once you pull it from the DB.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page