title: Can not correct to display data from ms sql tables in datagridview
body: <p>No idea how to fix that.
  So i have an imported table (screenshot) <strong>Patient</strong> (# 1) and <strong>Diagnoz</strong> (Diagnosis) (# 2) from the MS SQL Server. The first table contains a complete list of patient data and a foreign key for the id_diagnoz in which the Stage and Name_diagnoz is indicated. 
  Table (# 3) is a ready-made option for outputting data without unnecessary columns, but this is not a problem.<code>"select Pacient.id_patient, Pacient.Name, Pacient.Surname, Pacient.Middle_name, Pacient.Age, Pacient.Legal_address_Clinic, Diagnoz.Name_diagnoz, Diagnoz.Stage FROM Pacient JOIN Diagnoz ON Diagnoz.id_diagnoz = Pacient.id_diagnoz";</code> That's work well.</p>
  
  <hr>
  
  <p><em>The problem is</em> that when filling in the data from the textboxes and comboboxes, I need to first generate an id_diagnoz from the table (# 2) and with it add the other info to the patient table (# 1). However, I could not manage to do this for several hours, because even the error did not lead. Therefore, I decided to separately add the id_diagnoz to the empty table (# 4) to make sure that my query is working.
  Please, help me with this id_diagnoz and other data put into the patient table.</p>
  
  <pre><code>  private void button5_Click(object sender, EventArgs e)
          {
  
              using (SqlConnection conn = new SqlConnection("Data Source=DESKTOP-R551818\\SQLEXPRESS;Initial Catalog=Fond;Integrated Security=True"))
              {
  
  
  
                  SqlDataAdapter comm = new SqlDataAdapter("SELECT id_diagnoz FROM Diagnoz WHERE Name_diagnoz = '" + comboBox2.Text + "' and Stage = '" + comboBox3.Text + "'" +
                      "INSERT INTO Pacient (Name, Surname, Middle_name, Column__Passport, Legal_address_Clinic, Age)" +
                      " VALUES (@Name, @Surname, @Middle, @Passport, @AddresClinic, @Age) ", conn);
  
                  comm.SelectCommand.Parameters.AddWithValue("@Name", textBox3.Text);
                  comm.SelectCommand.Parameters.AddWithValue("@Surname", textBox4.Text);
                  comm.SelectCommand.Parameters.AddWithValue("@Middle", textBox5.Text);
                  comm.SelectCommand.Parameters.AddWithValue("@Passport", maskedTextBox1.Text);
                  comm.SelectCommand.Parameters.AddWithValue("@AddresClinic", comboBox1.Text);
                  comm.SelectCommand.Parameters.AddWithValue("@Age", textBox7.Text);
                  DataSet ds = new DataSet();
                  comm.Fill(ds);
                  //da.Fill(ds, "Pacient");
  
                  dataGridView2.DataSource = ds.Tables[0];
                  conn.Close();
  
                  conn.Open();
  
              }}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FTc9J.png" rel="nofollow noreferrer">Screenshot for understanding</a></p>