首先,作为测试,我们在这里创建一个名为testdb的数据库,和一个名为test_table的表: create database if not exists testdb default charset utf8 collate utf8_general_ci; use testdb; drop table if exists test_table; create table test_table ( id integer, name varchar(30), age integer, poin…
项目中用到含有中文字段的数据CSV文件,导入Mysql数据中发现中文内容乱码. 分析原因:因为数据库字符编码问题引起. [1]创建utf-8字符集数据库 CREATE DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; [2]更改数据库的字符编码 ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 如上,更改了数据…
using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Windows.Forms; using Excel=Microsoft.Office.Interop.Excel; namespace WinFromAPP { public partial class Form1 : Form { public Form1() { InitializeComponent(…