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. General Programming
  3. C#
  4. Inserting data into MySQL from .Net

Inserting data into MySQL from .Net

Scheduled Pinned Locked Moved C#
csharpmysqlvisual-studiohelpquestion
5 Posts 3 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.
  • H Offline
    H Offline
    happyheartcs
    wrote on last edited by
    #1

    Hi All, Actually I was't sure of which message board to choose. Anyhow, my problem is that I select arabic data from MySQL table into a DataTable in VS.net but when I try 2 insert the selected data, it inserts it as '???' though I chose the "utf-8"character set in connection string. It's just that when the records are fetched to .net table, they are transformed to "???" Any clue how 2 solve this?? Thnx a lot in advance

    G L 2 Replies Last reply
    0
    • H happyheartcs

      Hi All, Actually I was't sure of which message board to choose. Anyhow, my problem is that I select arabic data from MySQL table into a DataTable in VS.net but when I try 2 insert the selected data, it inserts it as '???' though I chose the "utf-8"character set in connection string. It's just that when the records are fetched to .net table, they are transformed to "???" Any clue how 2 solve this?? Thnx a lot in advance

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Which version of mysql are you running? First make sure that you connection string looks like something like this: "Server={0}; Port={1}; Database={2}; Uid={3}; Pwd={4}; Charset=utf8;" In order to check if the actual records contain '???' or they are transformed into them after checking execute this query: SELECT HEX(column_name) FROM table_name; IF it displays 3f then the data itself is ???

      H 1 Reply Last reply
      0
      • H happyheartcs

        Hi All, Actually I was't sure of which message board to choose. Anyhow, my problem is that I select arabic data from MySQL table into a DataTable in VS.net but when I try 2 insert the selected data, it inserts it as '???' though I chose the "utf-8"character set in connection string. It's just that when the records are fetched to .net table, they are transformed to "???" Any clue how 2 solve this?? Thnx a lot in advance

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hi I was have the same problem I solve it like this ...... -- My DataBase Charset was Latin_swidsh_c1 -- when I have to insert any word any recored in arabic I have to run this Query , it's like that Exactly.... set names cp1256 and when I found my old project I will write it exactly ... hope that will help you ... for now cause in the past I got sick of this problem but thank GOD it's solved now ... so I will search for you ... it's promise :) Have a good day ...

        I know nothing , I know nothing

        L 1 Reply Last reply
        0
        • G Giorgi Dalakishvili

          Which version of mysql are you running? First make sure that you connection string looks like something like this: "Server={0}; Port={1}; Database={2}; Uid={3}; Pwd={4}; Charset=utf8;" In order to check if the actual records contain '???' or they are transformed into them after checking execute this query: SELECT HEX(column_name) FROM table_name; IF it displays 3f then the data itself is ???

          H Offline
          H Offline
          happyheartcs
          wrote on last edited by
          #4

          I'm using mysql 4.1 The original data doesn't contain '?????' & yeah my connection string looks like u said :( Any clue?? Thanks a lot

          1 Reply Last reply
          0
          • L Lost User

            Hi I was have the same problem I solve it like this ...... -- My DataBase Charset was Latin_swidsh_c1 -- when I have to insert any word any recored in arabic I have to run this Query , it's like that Exactly.... set names cp1256 and when I found my old project I will write it exactly ... hope that will help you ... for now cause in the past I got sick of this problem but thank GOD it's solved now ... so I will search for you ... it's promise :) Have a good day ...

            I know nothing , I know nothing

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            ok now here we go I will tell you exactly what I did to solve this just make sure that when you create the database it has latin1_swedish_ci Charset and the all other things are default , my replay before was for Php & MySql ......... ( set names cp1256 ) sorry have a good day

            I know nothing , I know nothing

            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