Populating C# ListView With Mysql Table -


i don't understand why listview empty.

enter image description here

enter image description here

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.

enter image description here


Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -