SQL Strings

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2009
Posts: 8
Reputation: f_atencia is an unknown quantity at this point 
Solved Threads: 0
f_atencia f_atencia is offline Offline
Newbie Poster

SQL Strings

 
0
  #1
Sep 23rd, 2009
Hi all,

I have an SQL Datasource:
  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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 176
Reputation: Kusno is an unknown quantity at this point 
Solved Threads: 13
Kusno's Avatar
Kusno Kusno is offline Offline
Junior Poster

Re: SQL Strings

 
0
  #2
Sep 24th, 2009
Originally Posted by f_atencia View Post
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
NEVER NEVER NEVER GIVE UP
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,187
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 571
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: SQL Strings

 
0
  #3
Sep 24th, 2009
Try using this:
  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>
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 185
Reputation: jbisono is an unknown quantity at this point 
Solved Threads: 24
jbisono's Avatar
jbisono jbisono is offline Offline
Junior Poster

Re: SQL Strings

 
0
  #4
Sep 24th, 2009
yes sknake you right.
If your already resolved your issue, flag it as solved.
José Bisonó
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC