943,535 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 427
  • ASP.NET RSS
Sep 23rd, 2009
0

SQL Strings

Expand Post »
Hi all,

I have an SQL Datasource:
asp.net Syntax (Toggle Plain Text)
  1. <asp:SqlDataSource ID="shownMovie" runat="server"
  2. ConnectionString="<%$ ConnectionStrings:MovieTix %>"
  3. SelectCommand="SELECT movie.title, movie.category FROM [movie],[session],[theatre],[cinema]
  4. WHERE cinema.cinemaLocation=theatre.cinemaLocation AND theatre.theatreNumber=session.theatreNumber
  5. AND session.movieID=movie.movieID AND ([movieID] = @movieID)">
  6. <SelectParameters>
  7. <asp:ControlParameter ControlID="GridView1" Name="movieID"
  8. PropertyName="SelectedValue" Type="String" />
  9. </SelectParameters>
  10. </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.
Last edited by peter_budo; Sep 27th, 2009 at 8:35 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Similar Threads
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
f_atencia is offline Offline
52 posts
since Aug 2009
Sep 24th, 2009
0

Re: SQL Strings

Click to Expand / Collapse  Quote originally posted by f_atencia ...
Hi all,

I have an SQL Datasource:
<aspqlDataSource 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>
</aspqlDataSource>

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
Reputation Points: 11
Solved Threads: 17
Junior Poster
Kusno is offline Offline
191 posts
since Aug 2007
Sep 24th, 2009
0

Re: SQL Strings

Try using this:
text Syntax (Toggle Plain Text)
  1. <asp:SqlDataSource ID="shownMovie" runat="server"
  2. ConnectionString="<%$ ConnectionStrings:MovieTix %>"
  3. SelectCommand="SELECT movie.title, movie.category FROM [movie],[session],[theatre],[cinema]
  4. WHERE cinema.cinemaLocation=theatre.cinemaLocation AND theatre.theatreNumber=session.theatreNumber
  5. AND session.movieID=movie.movieID AND (movie.[movieID] = @movieID)">
  6. <SelectParameters>
  7. <asp:ControlParameter ControlID="GridView1" Name="movieID"
  8. PropertyName="SelectedValue" Type="String" />
  9. </SelectParameters>
  10. </asp:SqlDataSource>
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 24th, 2009
0

Re: SQL Strings

yes sknake you right.
Reputation Points: 56
Solved Threads: 56
Posting Pro in Training
jbisono is offline Offline
431 posts
since May 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Filtering records using a Dropdown list control from two tables
Next Thread in ASP.NET Forum Timeline: Creating a search





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC