0

I have inserted some text in the Json format in BLOB column of MySQL. Now I am trying to retrieve blob data in Json(Text) format then it returns to c# like as a bytes of array. Can anybody help me to get the actual string from it, It will be greatfull. Thanks in advance.

Pushpendra
  • 16
  • 5
  • 1
    what have you tried? What error do you get? Please show your current attempt and research – Gilad Green Sep 14 '17 at 10:38
  • Hey Gilad, As I have mentioned, It is returning bytes of array in c# and I am not able to convert as string same as I have inserted.. – Pushpendra Sep 14 '17 at 11:27
  • first of all...it is pointless to insert in MySQL database json text, it is not efficient in any cases...you need to store in your table proper format of your class. Try serialize your json string to class and then insert/query/update/delete.. do everything correctly. It is a wrong way of db usage. But if you still would like to insert in your db string -> update your database field with NVCHAR(MAX) and then it will allow you to store string. But how I said previously it is not efficient way of doing because you need id..and other characters to query your table. – Jevgenij Kononov Mar 16 '18 at 08:47
  • Thank you for your response, I have found a way to insert Json data into the blob columns using the messagepacks library. It serialises the de-serialises the Json object into the byte[]. – Pushpendra Apr 22 '18 at 04:54

0 Answers0