In the sql assignment, you are specifying that you wish to see all records where the serial number begins with XM.
If you want to return all records where the serial number is 123456, then
sql1="select * from master_pcba_debug where serialno = '123456'" (assuming that the serial number field is a string data type (Varchar, etc.)
Secondly; why are you changing the data within the current record before trying to populate the flexgrid?
Take a look
HERE for example mshFlexGrid code.