Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. problem on inserting non english values in DB

problem on inserting non english values in DB

Scheduled Pinned Locked Moved ASP.NET
databasesysadminhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sajjy
    wrote on last edited by
    #1

    hi guys I have some problem in inserting non english values in AJAX method (in AJAX i send information on get method) :doh: my DB column type is : "ntext" (to allow non english) i checked , i get right data on server , but wrong data would inputed to the DB !!! :confused: some code is like that :

    string res = Request["amount"].ToString() + "," + Request["price"].ToString() + "," + Request["year"].ToString() + "," + Request["month"].ToString() + "," + Request["day"].ToString() + "," + Session["code"].ToString() + "," + Request["kind"].ToString() + "," + "1" + ",'" + Request["comment"].ToString()+ "'";
    string str = "INSERT INTO invest (amount,totalprice,year,month,day,personID,typeID,canedit,cms)VALUES(" + res + ")";
    SqlDataSource1.InsertCommand = str;
    SqlDataSource1.Insert();
    Response.Write("اطلاعات وارد شد");
    Response.End();

    M 1 Reply Last reply
    0
    • S sajjy

      hi guys I have some problem in inserting non english values in AJAX method (in AJAX i send information on get method) :doh: my DB column type is : "ntext" (to allow non english) i checked , i get right data on server , but wrong data would inputed to the DB !!! :confused: some code is like that :

      string res = Request["amount"].ToString() + "," + Request["price"].ToString() + "," + Request["year"].ToString() + "," + Request["month"].ToString() + "," + Request["day"].ToString() + "," + Session["code"].ToString() + "," + Request["kind"].ToString() + "," + "1" + ",'" + Request["comment"].ToString()+ "'";
      string str = "INSERT INTO invest (amount,totalprice,year,month,day,personID,typeID,canedit,cms)VALUES(" + res + ")";
      SqlDataSource1.InsertCommand = str;
      SqlDataSource1.Insert();
      Response.Write("اطلاعات وارد شد");
      Response.End();

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      check if the datatype of the column nvarchar?

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      S 1 Reply Last reply
      0
      • M Manas Bhardwaj

        check if the datatype of the column nvarchar?

        Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        S Offline
        S Offline
        sajjy
        wrote on last edited by
        #3

        it is ntext , i changed it to nvarchar(MAX) to see if gets better , but didn`t came true !! :doh:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups