Populating C# ListView With Mysql Table -
i don't understand why listview empty.


refresh button = button2, , code :
private void button2_click(object sender, eventargs e) { mysqldataadapter ada = new mysqldataadapter("select * teams", _dbconnect.getconnection()); datatable dt = new datatable(); ada.fill(dt); (int = 0; < dt.rows.count; i++) { datarow dr = dt.rows[i]; listviewitem listitem = new listviewitem(dr["team_id"].tostring()); listitem.subitems.add(dr["team_name"].tostring()); listview1.items.add(listitem); } }
you should add @ least 1 column listview. add column display sub-item.

Comments
Post a Comment