Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

c# sqldatareader to list

List<someObject> objectList = new List<someObject>();
SqlDataReader rdr = cmd.ExecuteReader();

 while (rdr.Read())
{
	someObject o = new someObject();
	o.id = rdr["id"];
    o.name = rdr["name"];
    
 	objectList.Add(o);
}
 
PREVIOUS NEXT
Tagged: #sqldatareader #list
ADD COMMENT
Topic
Name
3+7 =