title: Error get data from pgadmin to c# Visual Studio
body: <p>This is my code for selecting data from C# to pgadmin function:</p>
  
  <pre><code>private void button_load_Click(object sender, EventArgs e)
  {
          try
          {
              DGV_customers.DataSource = null;
              //load all data from table customers
              conn.Open();
              sql = "select * from customers_select()";
              cmd = new NpgsqlCommand(sql, conn);
              dt = new DataTable();
              dt.Load(cmd.ExecuteReader());
              DGV_customers.DataSource = dt;
              conn.Close();
          }
          catch (Exception ex)
          {
              MessageBox.Show("Error: " + ex.Message, "FAIL!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
              conn.Close();
          }
  }
  </code></pre>
  
  <p>My function in pgadmin (postgresql):</p>
  
  <pre><code>create function customers_select()
  returns table
  (
      _member_id int,
      _name character,
      _phone_number character,
      _address character,
      _height character,
      _weight character,
      _age character
  )
  as
  $$
  begin
      select member_id, name, phone_number, address, height, weight, age;
  end
  $$
  language plpgsql
  </code></pre>
  
  <p>This shows an error: </p>
  
  <blockquote>
    <p>42703: column "member_id" does not exist</p>
  </blockquote>