This is just sample code, but I wanted to know what would be the equivalent .net cobol to the while(dr.read) and populate to a list.
publicclassStudent{publicint ID {get;set;}publicstringName{get;set;}publicDateTimeDateOfBirth{get;set;}} after that List<Student> student =newList<Student>();SqlConnection conn =newSqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=D:\Prac\TestAssembly\ForumsProjectCSharp\App_Data\Studetnt.mdf;Integrated Security=True;User Instance=True");SqlCommand cmd =newSqlCommand("select * from Student", conn);SqlDataReader dr;try{ conn.Open(); dr = cmd.ExecuteReader();while(dr.Read()){ student.Add(newStudent(){ ID = dr.GetInt32(dr.GetOrdinal("ID")),Name= dr.GetString(dr.GetOrdinal("Name")),DateOfBirth= dr.GetDateTime(dr.GetOrdinal("DateOfBirth"))});} dr.Close();}catch(Exception exp){throw;}