Usually, the reported error raises when you are selecting 'SelectedIndex' from the collection. As an example,
cmd.Parameters.AddWithValue("@company",ddlcompany.SelectedItem);
Should be ddlcompany.SelectedIndex or ddlcompany.SelectedValue because SelectedItem is referencing the ListItem itself, not a value.