Answers for "c# sqldatareader to list"

SQL
0

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);
}
Posted by: Guest on May-04-2022

Code answers related to "SQL"

Browse Popular Code Answers by Language