I have a Access DB with multiple columns,
| Mark1 | Mark2 | Mark3 | Mark4 | Mark5 |
| 99 | 87 | 78 | 78 | 79 |
I need to get the max value and display it in a textbox
then I need to get the avg value and display it in a text box
here is my code:please help with the part as bold
- connection.Open();
- OleDbCommand command = new OleDbCommand();
- command.Connection = connection;
- string query = "select* from Students WHERE Firstname LIKE '" + tbsearchid.Text + "' OR ID1 like '" + tbsearchid.Text + "' ";
- command.CommandText = query;
- OleDbDataReader reader = command.ExecuteReader();
- while (reader.Read()) {
- tbFname.Text = reader["Firstname"].ToString();
- tbLname.Text = reader["Lastname"].ToString();
- string course1Text = reader["Course1"].ToString(), course2Text = reader["Course2"].ToString();
- tbmulti.Text = "Course1: " + course1Text + Environment.NewLine + "Course2: " + course2Text;
- help here >> tbhighmark.Text = max Value;
- help here >> tbCourseAvg.Text = tbCourseAvg value;
- }
- connection.Close();

Rajanikant HawaldarPosted Aug 7, 2019, 3:40 AM
J VsPosted Aug 7, 2019, 2:20 AM
Rajanikant HawaldarPosted Aug 7, 2019, 2:11 AM
J VsPosted Aug 7, 2019, 1:43 AM
Amit MohantyPosted Aug 7, 2019, 1:35 AM
J VsPosted Aug 7, 2019, 12:18 AM
Amit MohantyPosted Aug 6, 2019, 4:25 AM
Rajanikant HawaldarPosted Aug 6, 2019, 3:17 AM
J VsPosted Aug 6, 2019, 2:45 AM
Rajanikant HawaldarPosted Aug 6, 2019, 2:30 AM
J VsPosted Aug 6, 2019, 2:18 AM
Rajanikant HawaldarPosted Aug 6, 2019, 2:13 AM