列表执行SQL按条件
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{ …………………… }}
推荐阅读