0

Hi all,

I have an SQL Datasource:

<asp:SqlDataSource ID="shownMovie" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MovieTix %>" 
        SelectCommand="SELECT movie.title, movie.category FROM [movie],[session],[theatre],[cinema] 
                       WHERE cinema.cinemaLocation=theatre.cinemaLocation AND theatre.theatreNumber=session.theatreNumber
                       AND session.movieID=movie.movieID AND ([movieID] = @movieID)">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="movieID" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

However, i get the following error message:
Ambiguous column name 'movieID'.

Basically I am trying to join it up so whatever cinema the customer wishes to see pulls up a record of movies being shown at that chosen cinema from a previous gridview.

Any help would be appreciated.

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by jbisono
0

Hi all,

I have an SQL Datasource:
<asp:SqlDataSource ID="shownMovie" runat="server"
ConnectionString="<%$ ConnectionStrings:MovieTix %>"
SelectCommand="SELECT movie.title, movie.category FROM [movie],[session],[theatre],[cinema]
WHERE cinema.cinemaLocation=theatre.cinemaLocation AND theatre.theatreNumber=session.theatreNumber
AND session.movieID=movie.movieID AND ([movieID] = @movieID)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="movieID"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>

However, i get the following error message:
Ambiguous column name 'movieID'.

Basically I am trying to join it up so whatever cinema the customer wishes to see pulls up a record of movies being shown at that chosen cinema from a previous gridview.

Any help would be appreciated.

maybe, you forget the red-bold one text.

thanks

0

Try using this:

<asp:SqlDataSource ID="shownMovie" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MovieTix %>" 
        SelectCommand="SELECT movie.title, movie.category FROM [movie],[session],[theatre],[cinema] 
                       WHERE cinema.cinemaLocation=theatre.cinemaLocation AND theatre.theatreNumber=session.theatreNumber
                       AND session.movieID=movie.movieID AND (movie.[movieID] = @movieID)">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="movieID" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.