Wondering how to tweek my code to first check if an account is marked active before login. I have an SQL table with column header "Active". The data type is Bool. Here is an example of table data(see image)

When user clicks login, the code needs to check if user is Active. If "Active" is "False", > MessageBox.Show"Account Locked"
I am a new to C#, so not sure how to go about this...Here is the login code.
private void btnlogin_Click(object sender, EventArgs e)
{
if (cmbusertype.SelectedItem == null)
{
MessageBox.Show("Please select User Type to continue...");
cmbusertype.Focus();
return;
}
if (txtuserid.Text == "")
{
MessageBox.Show("Please enter your UserID...");
txtuserid.Focus();
return;
}
if (txtpassword.Text == "")
{
MessageBox.Show("Please enter your password...");
txtpassword.Focus();
return;
}
try
{
SqlConnection con = new SqlConnection(@"Data Source = (LocalDB)\MSSQLlocaldb; Initial Catalog = AdminAuthentication; Integrated Security = True"); ;
con.Open();
SqlCommand cmd = new SqlCommand("select * from UserRegistration where userID='" + txtuserid.Text + "' and password='" + txtpassword.Text + "'", con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
string cmbItemValue = cmbusertype.SelectedItem.ToString();
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
if ((dt.Rows[i]["UserType"].ToString() == cmbItemValue) && (cmbusertype.SelectedIndex == 0)) //you can use 2 instead of usertype in that index because usertype column is in 2 index
{
MessageBox.Show("You are logged in as " + dt.Rows[i][6]);
MessageBox.Show("Displaying Admin Dashboard");
this.Hide();
AdminPanel ap = new AdminPanel();
ap.Show();
}
else
{
MessageBox.Show("You are logged in as " + dt.Rows[i][6]);
MessageBox.Show("Displaying Exam Options.Good Luck!");
this.Hide();
StartTest st = new StartTest();
st.Show();
}
}
}
else
{
MessageBox.Show("Invalid username and/or Password.Please try again. \nAttempts: " + attempts + "out of 3");
txtpassword.Clear();
attempts++;
}
if (attempts == 4)
{
MessageBox.Show("You have reached maximum login attempts. Click 'Forgot Password' below to reset it.");
btnlogin.Enabled = false;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}