title: C# Get all items from a database row
body: <p>I want to create an edit window to edit an Row in the Database.</p>
  
  <p>How I can read all items from a database row?</p>
  
  <p>My code until now is:</p>
  
  <pre><code>private void FirmCustomerValues()
      {
          config conf = new config();
          connection = new MySqlConnection(conf.connection_string);
          try
          {
              if (this.OpenConnection() == true)
              {
                  MySqlCommand cmd = new MySqlCommand("SELECT * FROM firmenkunden WHERE id='" + firmCustomerID + "'",connection);
  
                  MySqlDataReader reader = cmd.ExecuteReader();
                  while (reader.Read())
                  {
                      foreach (var row in reader)
                      {
                          System.Windows.Controls.TextBox textbox = new TextBox();
  
                          // Textbox Properties
                          textbox.Width = 159;
                          textbox.Name = "";
                          textbox.Text = reader[1].ToString();
  
                          textboxWP.Children.Add(textbox);
                      }
  
  
  
                  }
  
              }
          }
          catch (MySqlException ex)
          {
              MessageBox.Show(ex.Message);
          }
      }
  </code></pre>
  
  <p>But this is not working.
  Has anyone a idea how to solve this?</p>
  
  <p>I think i need a for loop too. Im new to C# so sorry if the answer is simple.</p>