I got a variable "StudentInfo" assigned with below value in a curly bracket:
var StudentId = StudentBll.GetStudents(false).Select(t => new { ID = t.ID, Name = t.Name }).ToList();
comboStudent.DataSource = StudentId;
comboStudent.DisplayMember = "Name";
comboStudent.ValueMember = "ID";
var StudentInfo = comboStudent.SelectedItem;
The value of var StudentInfo returns as:
{ ID: 1, Name: "John" }
ID: 1
Name: "John"
How can I reference the Name only from the StudentInfo?
For example,
lblName.Text = StudentInfo.Name ?
lblName.Text = StudentInfo(0).Name ?
Both doesn't work...