try this :
replace this:
query = select max(refno)+1 from porder;
orc.open()
cmd = New OracleCommand(query1, orc)
with:
query = select max(refno)+1 from porder;
orc.open()
cmd = New OracleCommand(query, orc)
as you are passing the incorrect query.
hope it helps :)