.net - There is no row at position 0 -
cmd.commandtext = "select * product prod_code='" & trim(txtprod_code.text) & "' , branch='" & w_location & "' , avail_stock <>" & (0) & "" cmd.commandtype = commandtype.text con.open() da_uqc.selectcommand = cmd cmd.connection = con da_uqc.fill(ds_uqc) m_qty = ds_uqc.tables(0).rows(0)(4) 'error da_uqc.dispose() ds_uqc.dispose() cmd.dispose()
is possible give m_qty = ds_uqc.tables(0).rows(0)(4)
?
you're getting run-time error denoting there no rows @ in table since query string not matching rows, may check rows count first:
if ds_uqc.tables(0).rows.count > 0 m_qty = ds_uqc.tables(0).rows(0)(4) end if
p.s: comments in vb.net, starts '
, not c#.net 1 //
.
Comments
Post a Comment