zoukankan      html  css  js  c++  java
  • [整理]VS2005,DetailsView1控件学习记录。

    I Use Visual Studio 2005 In My Project,Today I Find Some Problem.
    in my sql server 2005 database,there have a field(bit),i use the controls DetailsView,for show the Detail info.
    because the type bit's value true or false,but i can not to show true or false,i want to show the lock or unlock,here is the resolvent.

    note 1 ---use sql.
    this is the code:"select userlock=(case when userlock=0 then 'lock' else 'unlock' end)" form tablename";

    note 2 --- use databound
        protected void DetailsView1_DataBound(object sender, EventArgs e)
        {
            Label LabTemp = (Label)DetailsView1.FindControl("Label1");
            if (LabTemp.Text == "True")
            {
                LabTemp.Text = "lock";
            }
            else
            {
                LabTemp.Text = "unlock";
            }
        }
    上面第二条解决方法,必须将该列转化成模板列才行,否则是没办法改变显示的。

  • 相关阅读:
    有道
    excel 数据入库
    iso-8859-1 Unicode 编码
    爬虫编码问题
    WIKi 百科爬虫
    降低耦合性获取微博数据
    Python基础总结3-字符串
    Python基础总结2
    Linux常用命令04(其他命令)
    Linux常用命令03(系统信息)
  • 原文地址:https://www.cnblogs.com/Apollo/p/364139.html
Copyright © 2011-2022 走看看