{ con.Open(); cmd =new SqlCommandd("SELECT * FROM student",con); rd= cmd.ExecuteReader(); student stud=new student(); ArrayList list = new ArrayList(); while (rd.Read()) { stud.roll = (int)rd[0]; stud.name = (string) rd[1]; stud.lname =(string) rd[2]; list.Add(stud); dataGridView1.DataSource = list; } con.Close(); }
while (rd.Read()) { var stud = new Student(); stud.roll = (int)rd[0]; stud.name = (string) rd[1]; stud.lname =(string) rd[2]; list.Add(stud); } dataGridView1.DataSource = list;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)