public void Getdata(Object o, EventArgs e) { studentdb = new StudentDB(); Student stu = studentdb.GetStudent(Convert.ToInt32(id1.Text)); name.Text = stu.Name; address.Text = stu.Address; phone.Text = stu.Phone; }
public Studentlist(int id) { studentdb = new StudentDB(); Student stu = studentdb.GetStudent(id); List <Student> sb = new List <Student>(); sb.Add(new Student { Address = stu.Address }); //sb.Add(new Student { Phone = stu.Phone }); listviewstudentlist.ItemsSource = sb; }