c# - Unable to cast object of type 'System.Int16' to type 'System.String' -
i encounter following exception in linq query .
unable cast object of type 'system.int16' type 'system.string'.
var query = t in dt.asenumerable() select new { sys_db= t.field<int16>("process_id").tostring() + "|" + t.field<string>("db_code").tostring(), process_name = t.field<string>("process_name").tostring() };
why problem appear , how fix ?
this
t.field<string>("db_code").tostring()
perhaps should this:
t.field<short>("db_code").tostring()
or equivalent
t.field<int16>("db_code").tostring()
Comments
Post a Comment