简体   繁体   中英

Insert Cyrillic text into SQL Server

I need to insert Cyrillic text into a SQL Server database. I'm using MVC 4, and the controller code is:

    public ActionResult AddCategory(Ferro_Balkan.Models.category Cat)
    {
        Ferro_Balkan.Models.ferroEntities ent = new Ferro_Balkan.Models.ferroEntities();

        if (ModelState.IsValid)
        {
            ent.Categoriis.Add(Cat);
            ent.SaveChanges();
            return RedirectToAction("AdminCategory", "Admin");
        }

        return View(Cat);
    }

I don't know how to insert Cyrillic text... I need a solution that works within the code listed.

You need to verify that charset of the page submitting Cyrillic value(Cat) to you is set to UTF-8. If it is then you should not have any problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM