views:

47

answers:

1

everything was working fine while the database of my asp.net mvc 2 site was in the app_data folder , after i transfered it to sqlserver express all the Cyrillic data i added after that appears in ????? :( I'm using nvarchar for my fields and collation is set to Cyrillic and yet .. ?????

any suggestions are appreciated

edit ://

[HttpPost]
        public ActionResult AddCity(CityInfo cityInfo)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    var dbM = new moonDB2();

                    dbM.CityInfoes.AddObject(cityInfo);
                    dbM.SaveChanges();
                    return RedirectToAction("Index");
                }
                else
                {

                    return View(cityInfo);
                }
            }
            catch
            {

                return View();
            }
        }
+1  A: 

I'm using nvarchar for my fields and encoding is set to Cyrillic

Irrelevant. NVarchar is unicode - so the encoding is not relevant. Encoding is relevant for varchar (coding page) only.

  • Validate it is the database, not the asp.net area
  • Are you ENCODING the letters in ASP.NET? What is your server side asp.net locale?

I am more likely to believe you f*** up the string handing in the ASP.NET side, or run thecode somewhere through a CHAR / VARCHAR columns. NVARCHAR handles cyrillic fine.

TomTom
my bad , i ment collation
Aviatrix
i'm using EF to insert the data directly into the DB see code provided
Aviatrix
Even more irrelevant. Collation is sort order. Even if you put it to japanese it has to store the nvarchar properly.. I suggest you throw out EF and make a TEST (SIMPLE) without EF. Strip an insert down to the minimum and validate the behvavior.
TomTom