Código vb:
Ver original
conn.open() MsgBox(conn.State.ToString) Try pgCommand = New NpgsqlCommand("SELECT columna1,columna2 FROM tabla WHERE campo3 = @dato;") pgCommand.Parameters.AddWithValue("@dato", primero) query_result = pgCommand.ExecuteReader() If query_result.HasRows Then MsgBox(conn.State.ToString) End If Do While query_result.Read MsgBox(query_result.GetValue(0).ToString) Loop Catch ex As Exception MsgBox(ex.Message) End Try conn.Close()