MySqlClient access field return System. Byte []

Source: Internet
Author: User

Symptom: System. Byte [] is returned using the MySqlClient access field. However, this problem does not occur when ODBC is used, and normal characters are returned.

Analysis: the value in the memory generated by the trail is indeed of the System. Byte [] type, but this type of array contains the byte value of characters. After directly converting byte [] data to the string type, it is found to be a correct string.

Solution:

1. The database type of this field in the data table in the database is varchar (15) binary. The key is this "binary". If this field is removed, it will be OK.

2. cast (name as varchar) name can also be used during select.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.