基于布尔数据库值显示的自定义文本 [英] Custom text displayed based on a boolean database value

查看:68
本文介绍了基于布尔数据库值显示的自定义文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中有bit列,并将其与显示为true或false的标签绑定在一起.我想显示为已接受还是未接受
感谢

I have bit column in the database and bind it with label it displayed true or false I want to be displayed as accepted or not accepted
thanks

推荐答案

我该怎么做是一种无用的主题行选择.

您是否会使用可基于变量状态设置标签文本的代码(可能使用条件运算符,例如<%=((bool)Eval("myCol")))来执行此操作? "Accepted":不接受"; %> ;,假设它在某种网格的模板定义中.

这是一个非常基本的问题,如果您正在为某个班级做一些事情(没有任何级别的我认为接受代码报酬是很合理的),那么您应该有一个当然要参考这本书?
How can I do is kind of a useless subject line choice.

You''d do this with code that sets the label text based on the state of the variable, perhaps using the conditional operator, something like <%= ((bool)Eval("myCol")) ? "Accepted" : "Not Accepted"; %>, assuming it''s in a template definition for some sort of grid.

This is a pretty basic question, if you are working on something for a class ( there''s no level on which I''d accept it as remotely reasonable that you''re being paid to code ), then you should have a book to refer to, surely ?


这篇关于基于布尔数据库值显示的自定义文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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