List collections calling object

//Attribute

namespace SfcEnd_PCK_DIP
{
class Attribute
{
public string BoarBC { get; set; }
public string TASN { get; set; }
public string WLID { get; set; }
public string Opindex { get; set; }
}
}

//class

public List<Attribute> Get_CurLineWLArrange(string TASN)
{
string sqlStr = "Select WLID,OpIndex from CurLineWLArrange where TASN="+TASN+" order by OpIndex";

SqlDataReader objReader = SQLHelper.GetReader(sqlStr);
List<Attribute> sfcEnd_UM_SMT = new List<Attribute>();
while(objReader.Read())
{
Attribute objStu = new Attribute();
objStu.WLID = objReader["WLID"].ToString();
sfcEnd_UM_SMT.Add(objStu);
}
objReader.Close();

return sfcEnd_UM_SMT;
}

// Invoke method to get access to data objects
SfcEnd_UM_SMT_Class objWLID new new SfcEnd_UM_SMT_Class = ();
List <the Attribute> = objWLID.Get_CurLineWLArrange List ( "21 is");
IF (! List.Count = 0)
{
the foreach (Item in the Attribute List) // analysis target
{
String W is = item.WLID;
}
}

Guess you like

Origin www.cnblogs.com/Striveyoungfellow/p/11263364.html