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.

Recommended Answers

All 3 Replies

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

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>

yes sknake you right.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.