C # MYSQL connection time Question & quot; 0000-00-00 & quot;

Source: Internet
Author: User

The data volume displayed when I connect to the MYSQL database today is less than that of the database. Tracking shows that the time format allowed by MYSQL is different from that allowed by MSSQL.
 
MySqlConnection myconn = new MySqlConnection (
"Server = 192.168.1.99; uid = php; pwd = enamephp; database = db_ename;
Charset = utf8; Allow Zero Datetime = True ");
Myconn. Open ();
MySqlCommand myNamecmd = new MySqlCommand ("set names utf8", myconn );
MyNamecmd. ExecuteNonQuery ();
 
Charset = utf8; Allow Zero Datetime = True // sets the connection encoding: UTF8, followed by the time setting
Reference Source: http://jackyxfl.blog.163.com/blog/static/1641341502010112035859224/

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.