continue to retrieve data even the result is null c# : I have a program that will retrieve Student information and Class information. 
I already use  "if (!reader.HasRows)" to check if the student is existing but the problem is not all student is already registered in a certain class and I want it continue retrieving data even the values in the class information is Null. I am new to C# and any help and recommendation is deeply appreciated.

Here is my code!

  private void btnstudsearch_Click_1(object sender, EventArgs e)
        {
          
            SqlConnection con = new SqlConnection(@"data source = DELL-USER\SQLEXPRESS;integrated security = SSPI;database = Enrollment System");
            DataTable dt = new DataTable();
            con.Open();
            SqlDataReader reader = null;
            SqlCommand cmd = new SqlCommand("select tbl_studregs.fname, tbl_studregs.mname, tbl_studregs.lname, tbl_studregs.age, tbl_studregs.sex, 
            tbl_studregs.address, tbl_studregs.gname, tbl_studregs.gcnum, tbl_studregs.educlevel, tbl_class.yglevel, tbl_class.section from tbl_studregs 
                inner join tbl_class on tbl_studregs.classid = tbl_class.classid where tbl_studregs.studid = @id ", con);
            
            
            
            cmd.Parameters.AddWithValue("@id", txtstudsearch.Text);
            reader = cmd.ExecuteReader();
       
            if (!reader.HasRows)
            {
                MessageBox.Show("Student not found!Please recheck the student ID!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ClearAllTextBox();


            }

            else 
            {
                
                
                
                while (reader.Read())
                {
                   
                    txtstudfname.Text = reader.GetValue(0).ToString();
                    txtmname.Text = reader.GetValue(1).ToString();
                    txtstudlname.Text = reader.GetValue(2).ToString();
                    txtage.Text = reader.GetValue(3).ToString();
                    cboxsex.Text = reader.GetValue(4).ToString();
                    rtxtaddress.Text = reader.GetValue(5).ToString();
                   
                    txtgname.Text = reader.GetValue(6).ToString();
                    txtgcnum.Text = reader.GetValue(7).ToString();
                    cboxstudlevel.Text = reader.GetValue(8).ToString();
                    txtstudyearlev.Text = reader.GetValue(9).ToString();
                    txtstudsec.Text = reader.GetValue(10).ToString();
                    
                }
            }
        }
