title: How can I call the data from the database in C# and sql?
body: <p>I am working on a school project in C# and SQL.</p>
  <p>How can I make a condition in which if the first textbox is checked equals a word defined from inside the database it prints yes
  The idea is:
  The project is a library that sells school books for a specific town.
  In my project, there is a place to enter the price of books and define them in advance. For example, I put that the price of books for John's second grade is a hundred dollars.
  On the sales screen, I want him to print the price he entered (one hundred dollars) if he checks that in the combobox that the class is the second grade and the name of the school is John.</p>
  <pre><code>SqlDataAdapter adapt, adapt1;
  DataTable dt;
  con.Open();
  adapt = new SqlDataAdapter(&quot;select * from pricing where lib_grade like'&quot;, con)
  adapt1 = new SqlDataAdapter(&quot;select * from pricing where lib_schoolname like'&quot;, con);
  
  if (comboBox2.SelectedItem==adapt|| comboBox4.SelectedItem == adapt1)
  {
      MessageBox.Show(&quot;mission complete successfully&quot;);
  }
  </code></pre>