string typeID=((Label)e.Item.FindControl("Label1")).Text; //Label1在父DataList中
Response.Write(typeID); // <- 输出,检查是否有值
string commandText = "select * from type03 Where ID02='07'and ID01='01'";
Response.Write(typeID); // <- 输出,检查是否有值
string commandText = "select * from type03 Where ID02='07'and ID01='01'";
try:string typeID=((Label)e.Item.Parent.FindControl("Label1")).Text; //Label1在父DataList中
Response.Write(typeID);有输出值 就是Label1的值
--------------------------------------
string typeID=((Label)e.Item.Parent.FindControl("Label1")).Text; //Label1在父DataList中
加Parent后,有报错:未将对象引用设置到对象的实例怎么回事的呢。。