c# listBox1.DisplayMember ="姓名";显示不了中文的,英文的可以显示为啥啊!
MySqlConnectionmysql=newMySqlConnection("server=127.0.0.1;userid=root;password=123;da...
MySqlConnection mysql = new MySqlConnection("server=127.0.0.1;userid=root;password=123;database=sfps;port=3306");
mysql.Open();
MySqlCommand comand = new MySqlCommand("select * from test",mysql);
DataSet Dat = new DataSet();
MySqlDataAdapter data = new MySqlDataAdapter();
data.SelectCommand = comand;
data.Fill(Dat);
listBox1.DataSource = Dat.Tables[0];
listBox1.DisplayMember ="姓名"; 展开
mysql.Open();
MySqlCommand comand = new MySqlCommand("select * from test",mysql);
DataSet Dat = new DataSet();
MySqlDataAdapter data = new MySqlDataAdapter();
data.SelectCommand = comand;
data.Fill(Dat);
listBox1.DataSource = Dat.Tables[0];
listBox1.DisplayMember ="姓名"; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询