本人总结的3种:
1.根据前台获取的WID编号到后台去获取外键表数据返回,获取WName;
2.在实体类主键表Model中添加属性public string WName{get;set;},在前端获取Bll业务逻辑时加入Model.WName返回显示;
3.在sql语句中内联查询:sql=“select a.*,b.WName from Goods a left join Category b on a.WID=b.WID”
1.根据前台获取的WID编号到后台去获取外键表数据返回,获取WName;
2.在实体类主键表Model中添加属性public string WName{get;set;},在前端获取Bll业务逻辑时加入Model.WName返回显示;
3.在sql语句中内联查询:sql=“select a.*,b.WName from Goods a left join Category b on a.WID=b.WID”