zoukankan      html  css  js  c++  java
  • repeater找主键

    方法一:
    protected void rp1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    
    {
    //DataBinder.eval_r(e.Item.DataItem, "数据库字段")
    //int i = Convert.ToInt32(Databinder.eval_r(e.Item.DataItem,"ID"));
    Response.Write(DataBinder.eval_r(e.Item.DataItem, "Uname")+"
    ");
    
    }
    }
    
    方法二:
    
    protected void rp1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    
    {
    
    DataRowView drv = (DataRowView)e.Item.DataItem;
    
    Response.Write(drv.Row.ItemArray[0].ToString()+"
    ");
    
    }
    }
  • 相关阅读:
    matrix
    meizi
    公文流转系统
    10.21连接数据库进行添加
    9.27
    9.23课堂总结
    信息管理java
    大道至简读后感
    第二周
    7.7第一周
  • 原文地址:https://www.cnblogs.com/qq22144770/p/4841060.html
Copyright © 2011-2022 走看看