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. Text insert problem in the database

Text insert problem in the database

Scheduled Pinned Locked Moved ASP.NET
helpcsharpcssasp-netdatabase
12 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.
  • A amistry_petlad

    Hi All, I am inserting (copy and paste Chinese language text) in the textbox and try to insert them in the database ,i have used nvarchar(max) column type in the table it gives me ??????? mark in the table value after insertion of text when i displayed it on the asp.net page it display ??? mark in the grid . and when i directly copy this text in the table value it show me the chinese language why ? it not working ? inspite of i have took unicode type I want to make multi-lingual site can any body help me

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #3

    To the person who gave me a 1, if you're the OP, try answering me when I try to help you instead, if you're not, you answer his question if you want to disuade me from trying to help.

    Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

    A 1 Reply Last reply
    0
    • C Christian Graus

      So, you are saying the DB works fine, but your ASP.NET code is broken ? Can we see it ? I assume the insert code is the problem.

      Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

      A Offline
      A Offline
      amistry_petlad
      wrote on last edited by
      #4

      no ,here is one textbox and submit button in asp.net(vb) when i enter any Chinese language (copy text from MSword and paste it in the textbox) and click submit button on that button i am doing the insert data in the data base but the data which is going to insert is not in the same form which i have entered. Got it ? it insert ?????? in the table field. show the code below Imports System.Data Imports System.Data.SqlClient Imports System.Configuration Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim MyConnection As SqlConnection Dim cmd As SqlCommand MyConnection = New SqlConnection() MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("Local_DB").ConnectionString MyConnection.Open() cmd = New SqlCommand("Select * from empl", MyConnection) GridView1.DataSource = cmd.ExecuteReader() GridView1.DataBind() MyConnection.Close() End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MyConnection As SqlConnection Dim cmd As SqlCommand MyConnection = New SqlConnection() MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("Local_DB").ConnectionString MyConnection.Open() 'Dim MySQL As String = "Insert into NewEmp (fname, LName, Address, City, State, Postalcode, Phone, Email) Values (@Firstname, @LastName, @Address, @City, @State, @Postalcode, @Phone, @Email)" Dim MySQL As String = "Insert into empl (name1) Values (@name1)" cmd = New SqlCommand(MySQL, MyConnection) cmd.Parameters.Add(New SqlParameter("@name1", SqlDbType.VarChar, 11)) cmd.Parameters("@name1").Value = TextBox1.Text cmd.ExecuteNonQuery() MyConnection.Close() End Sub End Class

      C 1 Reply Last reply
      0
      • A amistry_petlad

        no ,here is one textbox and submit button in asp.net(vb) when i enter any Chinese language (copy text from MSword and paste it in the textbox) and click submit button on that button i am doing the insert data in the data base but the data which is going to insert is not in the same form which i have entered. Got it ? it insert ?????? in the table field. show the code below Imports System.Data Imports System.Data.SqlClient Imports System.Configuration Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim MyConnection As SqlConnection Dim cmd As SqlCommand MyConnection = New SqlConnection() MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("Local_DB").ConnectionString MyConnection.Open() cmd = New SqlCommand("Select * from empl", MyConnection) GridView1.DataSource = cmd.ExecuteReader() GridView1.DataBind() MyConnection.Close() End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MyConnection As SqlConnection Dim cmd As SqlCommand MyConnection = New SqlConnection() MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("Local_DB").ConnectionString MyConnection.Open() 'Dim MySQL As String = "Insert into NewEmp (fname, LName, Address, City, State, Postalcode, Phone, Email) Values (@Firstname, @LastName, @Address, @City, @State, @Postalcode, @Phone, @Email)" Dim MySQL As String = "Insert into empl (name1) Values (@name1)" cmd = New SqlCommand(MySQL, MyConnection) cmd.Parameters.Add(New SqlParameter("@name1", SqlDbType.VarChar, 11)) cmd.Parameters("@name1").Value = TextBox1.Text cmd.ExecuteNonQuery() MyConnection.Close() End Sub End Class

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #5

        amistry_petlad wrote:

        SqlDbType.VarChar

        Not NVarChar ?

        Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

        1 Reply Last reply
        0
        • C Christian Graus

          To the person who gave me a 1, if you're the OP, try answering me when I try to help you instead, if you're not, you answer his question if you want to disuade me from trying to help.

          Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

          A Offline
          A Offline
          amistry_petlad
          wrote on last edited by
          #6

          sorry for that i didnt get properly so I have click "no" "sorry about that " Please help me out

          C 1 Reply Last reply
          0
          • A amistry_petlad

            sorry for that i didnt get properly so I have click "no" "sorry about that " Please help me out

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #7

            I am happy to help you either way - I just find I get a lot of 1's when I try to help, and I don't know why. Did changing it to nvarchar help ?

            Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

            A 1 Reply Last reply
            0
            • C Christian Graus

              I am happy to help you either way - I just find I get a lot of 1's when I try to help, and I don't know why. Did changing it to nvarchar help ?

              Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

              A Offline
              A Offline
              amistry_petlad
              wrote on last edited by
              #8

              sorry :omg: you are really helpful but due to my foolness you miss the one point how can i help you to reward back this point sir.? can you provide me one more help? how can i directly type any language in the web page once i download the font ? can you help me ?

              C 1 Reply Last reply
              0
              • A amistry_petlad

                sorry :omg: you are really helpful but due to my foolness you miss the one point how can i help you to reward back this point sir.? can you provide me one more help? how can i directly type any language in the web page once i download the font ? can you help me ?

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #9

                Well, the user needs to have thier PC set up to be typing in that language. For testing, you can install more than one language, you can set up the language bar in your menu bar with a right click and choose the option ( I'd check for details, but I am on a mac ). Then you can choose different languages and work out how the keyboard works to enter them when they are selected.

                Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

                A 1 Reply Last reply
                0
                • C Christian Graus

                  Well, the user needs to have thier PC set up to be typing in that language. For testing, you can install more than one language, you can set up the language bar in your menu bar with a right click and choose the option ( I'd check for details, but I am on a mac ). Then you can choose different languages and work out how the keyboard works to enter them when they are selected.

                  Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

                  A Offline
                  A Offline
                  amistry_petlad
                  wrote on last edited by
                  #10

                  no , I didn't get you can you briefly elaborate me. so i can get better idea.

                  C 1 Reply Last reply
                  0
                  • A amistry_petlad

                    no , I didn't get you can you briefly elaborate me. so i can get better idea.

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #11

                    You can't make a user have access to a language, they need to configure their PC for it. I can't give more specific help than I gave b/c I am on a mac, I can't try it to reproduce, but I know on the task bar I have a language menu which lists languages I can pop between.

                    Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

                    A 1 Reply Last reply
                    0
                    • C Christian Graus

                      You can't make a user have access to a language, they need to configure their PC for it. I can't give more specific help than I gave b/c I am on a mac, I can't try it to reproduce, but I know on the task bar I have a language menu which lists languages I can pop between.

                      Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.

                      A Offline
                      A Offline
                      amistry_petlad
                      wrote on last edited by
                      #12

                      thanks this is for u :rose:

                      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