Jump to content
Sign in to follow this  
Sergio990

Select retorna-me a dobrar [RESOLVIDO]

Recommended Posts

Sergio990

Boas, mais uma vez venho tirar uma duvida XD

Eu tenho este codigo em Asp:

<asp:SqlDataSource ID="SqlDataSource16" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:cadastramentoGlobalConnectionString %>" 
                                
                                SelectCommand=" SELECT   portas.idPorta,portas.idInterconect,portas.nomePorta,portas.descricao,interconect.idInterconect 
                                                FROM    portas,interconect,host
                                                WHERE   (portas.idInterconect=interconect.idInterconect) and (interconect.idHost=@idHost) and ((SELECT COUNT(*) AS Expr1
                                                FROM    cabos
                                                WHERE   (idporta = cabos.idPortaOrigem) or (idporta = cabos.idPortadestino)) = 0)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="DropDownList1" Name="idHost" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>

O select funciona mas so que retorna-me os resultados a dobrar ou seja eu tenho so 5 portas:

portas.jpg

Uploaded with ImageShack.us

E ele na drop coloca-me isto:

numeroportas.jpg

Uploaded with ImageShack.us

Obrigado :cheesygrin:

Ps: Eu sei que inventei um pouco no select ;D E que neste momento nao é a melhor maneira de estar representado (A)

Select Original feito por:edgarzigne

Share this post


Link to post
Share on other sites
Sergio990

Ja vi onde estava o problema ;D

tinha de acrescentar no select mais um and xD (interconect.idHost=host.idHost)

Obrigado :cheesygrin:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.