如何根据空值禁用转发器中的列? [英] How to disable column in repeater based on null values?

查看:45
本文介绍了如何根据空值禁用转发器中的列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我有一张桌子作为tblStudentsInfo与SId,SName和电话。



现在我希望使用Repeater控件显示SName和Phone。



如果Phone有空值,我想禁用SName列。

预期输出如,



tblStudentsInfo



SName Phone

----- ------

Sai 1234567890

Raju 1245678922

Alex null

Rabet null

Ramesh 1245678990

Dear All,

I have a table as tblStudentsInfo with SId, SName, and Phone.

Now I want display SName and Phone using Repeater control.

If Phone has null values I want to disable SName column.
The expected output like,

tblStudentsInfo

SName Phone
----- ------
Sai 1234567890
Raju 1245678922
Alex null
Rabet null
Ramesh 1245678990

推荐答案

使用和不使用条件



Use with and without where condition

SELECT sname,(ISNULL(phone,'disabled')) as phone,(ISNULL(address,'disabled')) as address from tablename


这篇关于如何根据空值禁用转发器中的列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆