I use the following method to display some items from a database into a list view:
When I run this method, the list view gets updated as follows

I want to be able to select one of the id's and press another button which will run another query (delet for example)
I have tried
but even if the 0th item is clicked in the list view nothing happens
The following is defined elsewhere:
Any ideas?
Code:
private void search (string query)
{
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = query;
connection.Open();
Reader = command.ExecuteReader();
string results = null;
while (Reader.Read())
{
for (int i = 0; i < Reader.FieldCount; i++)
{
results = (Reader.GetValue(i).ToString());
Debug.WriteLine(results + "" + i);
if (i == 0)
{
item_object = results_view.Items.Add(results);
}
else if (i == 1)
{
item_object.SubItems.Add(results);
}
else if (i == 2)
{
item_object.SubItems.Add(results);
}
else if (i == 3)
{
item_object.SubItems.Add(results);
}
}
}
DataTable dtresults = new DataTable();
connection.Close();
}

I want to be able to select one of the id's and press another button which will run another query (delet for example)
I have tried
Code:
if (results_view.Items[0].Selected == true)
{
// Do Something
}
The following is defined elsewhere:
Code:
ListViewItem item_object = null;
Comment