列表执行SQL按条件
金蝶云社区-云社区用户Jp4Z3703
云社区用户Jp4Z3703
0人赞赏了该文章 1344次浏览 未经作者许可,禁止转载编辑于2016年04月26日 08:24:24
请教下 列表执行SQL时假如不存在值能否用if分支条件来?或者是有其他办法吗?string ysSql = string.Format(@"select FSELLER from T_BD_CUSTOMER where FCUSTID='{0}'",CustId); using (IDataReader reader = DBUtils.ExecuteReader(this.Context, ysSql)) while (reader.Read()) { If 不存在值就条件1{……………. } Else 存在值就条件2{ …………………… }}