Have if condition in the beginning of for loop as below
foreach (ListViewItem li in listView1.Items)
{
if (li.SubItems[0].Text=="Booked")
{
OleDbCommand cmd = new OleDbCommand("insert into bookings (code,client_name)values('" + li.SubItems[0].Text + "','" + li.SubItems[1].Text + "');", con);
cmd.ExecuteNonQuery();
}
}