I am doing Student Attendance project for college in win form with MySQL(C#).
see the below picture,. this is my form. In that i add three listbox with single column.(student no.)
In that My Client want Student name only and student no they do not want to display.
but i want to save the record based on the Student no. So is it possible Hidden Column in Listbox?.
My Code is
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select admin_no from student_admision_master where course='" + course_code + "' AND year='" + year_code + "' AND sem='" + semester_code + "' AND batch='" + batch_code + "'";
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
listBox1.Items.Add(Reader[0].ToString());
}
connection.Close();
student_admision_master datatable have all the detail of student. name, father name, address etc…
Please Give an idea to do this!….

How do you add the items to your ListBoxes? Please show some us some code.
You have a property called DisplayMember on your ListBox. Try to set your student name property as DisplayMember on your ListBox.