我想循环我的列表框,以便它显示一个名称,然后在它旁边显示一个分数。
有没有办法做到这一点?
MySqlConnection myConn = new MySqlConnection(connStr);
DataTable dTable = new DataTable();
string squery = "SELECT * FROM highscore";
MySqlDataAdapter dAdapter = new MySqlDataAdapter(squery, myConn);
dAdapter.Fill(dTable);
dAdapter.Dispose();
lstNames.DataSource = dTable;
lstNames.DisplayMember = "Name";
lstNames.ValueMember = "Name";