I have a listview that has 2 columns and a checkbox.
What i’m doing is if the checkbox is true, I want to check the text from columns 1 and 2 and make it a string. This is what I have.
for (int i = 0; i < listView1.Items.Count; i++)
{
if (listView1.Items[i].Checked == true)
{
listView1.Items.RemoveAt(i);
string sql = "uscolumn = '" + listView1.Items[i].ToString() + "' and ukcolumn = '" + listView1.Items[i].ToString() + "'";
}
}
The above code doesn’t work but i’m not sure which way to go with it, the .Check works as intended but the strings dont.
so in this example:
CheckBox|column1|Column2
True|Fruit|Apples
usColumn = "Fruit"
ulColumn = "Apples"
Here is my suggestion for you: