I'm no expert with VB but here is how it would be done in C#
for (int i =0; i< listView1.Items.Count; i++)
{
string value = listView1.Items[i].Text;
string Query = "INSERT INTO stockinhand(stockcode,stocknamename,quantity)VALUES ('" + value + "')";
}
or
string Query = String.Format("INSERT INTO stockinhand(stockcode,stocknamename,quantity)VALUES ('{0}')",value);