资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

DropDownList绑定数据时,可不可以不显示某一行数据?

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

DropDownList   specialtyList;  
  specialtyList.DataSource   =   ds.Tables["Specialty"].DefaultView;  
  specialtyList.DataTextField   =   ds.Tables["Specialty"].Columns["SpecialtyName"].Caption;  
  specialtyList.DataValueField   =   ds.Tables["Specialty"].Columns["SpecialtyID"].Caption;  
  specialtyList.DataBind();  
   
  现在想不显示Tables["Specialty"]中的某一行,请问高手用什么方法?

网友回答:

发表者:brightheroes

比如说,不要Specialty为1  
  DataRow[]   dr   =   ds.Tables["Specialty"].Select("Specialty=   1");  
  if(dr.Length   >   0)  
  {  
        dr[0].Delete();  
        ds.Tables["Specialty"].AccepteChanges();  
  }  
   
   
  .....  
  specialtyList.DataSource   =   ds.Tables["Specialty"].DefaultView;  
  specialtyList.DataTextField   =   ds.Tables["Specialty"].Columns["SpecialtyName"].Caption;  
  specialtyList.DataValueField   =   ds.Tables["Specialty"].Columns["SpecialtyID"].Caption;  
  specialtyList.DataBind();  
   
 

发表者:manbaum

ds.Tables["Specialty"].Filter   =   "field   !=   value";  
  specialtyList.DataSource   =   ds.Tables["Specialty"].DefaultView;

发表者:xulovewei

在DataView筛选你想要的数据后再绑定


 

 
热门推荐笔记本: 华硕笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved