In general, we use data representation for database storage that determines strings, such as 0 for ' male ' 1 for ' female ', and for more character string storage, which saves more storage space for the database.
However, from the database reading angle, the original number must be represented by the data to be displayed in text.
Workaround: 1. From the database read out in the foreground interface binding time, traverse that variable, the data into text, such as 0-> "male"
The 2.select database is changed with a statement.
StringBuilder strsql=new StringBuilder ();
Strsql.append ("Select Resource_id,shop_id,resource_name,resource_time,resource_weight,resource_unit,resource_ State,resource_price,resource_type=case resource_type when 0 Then ' meat ' when 1 Then ' Seafood ' when 2 then ' vegetables ' when 3 then ' seasoning ' When 4 Then ' noodles ' when 5 then ' flour ' when 6 then ' egg ' else ' other ' END ');
Strsql.append ("from resource");
Format: Select Xx,yy,zz=case zz When 0 Then ' ... ' when 1 Then ' ... ' when ... else ' other ' end
from table_name;