c# - How to change Textbox text with each scanned barcode and fire ontextchange event -
i trying change text inside textbox everytime barcode scanned. program able take scanned barcode , fetch data database based on barcode text using ontextchange event, when scanned barcode on second time added barcode next first barcode input. example :
- 00111104
- 0011110400111105
i facing 2 error in here:
first, barcode scanned added next first one.
second, ontextchange event can't fire without taking focus outside textbox. using asp.net using vb code behind. here code far:
private sub selectdata() sql = "select * tbl_take [badge id] = '" + txtscanid.text + "'" cmd = new sqlcommand(sql, con) drdatareader = cmd.executereader while (drdatareader.read()) 'taking data database' end while end sub protected sub txtscanid_textchanged(sender object, e eventargs) handles txtscanid.textchanged call selecteddata() end sub
i set focus on txtscanid inside page load.
can me how make current barcode scanned replace last barcode in textbox. there other way fire ontextchange?
thanks in advances. appreciate though.
Comments
Post a Comment