Want more features on Pastebin? Sign Up, it's FREE!
Guest

ASPX SQL PROBLEM

By: a guest on May 26th, 2012  |  syntax: None  |  size: 1.81 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <asp:DropDownList ID="ddlHero1" runat="server" DataSourceID="ddlDataSource0"                        DataTextField="ChampName" DataValueField="ChamadpName" AutoPostBack="True">
  2.                                     </asp:DropDownList>
  3.                                     <asp:SqlDataSource ID="ddlDataSource0" runat="server"
  4.                                         ConnectionString="<%$ ConnectionStrings:mobamanagerConnectionString             %>" SelectCommand="SELECT [ChampName] FROM [Champions] WHERE Champname NOT IN (
  5. SELECT [ChampName] FROM [Champions] WHERE Champname=@ddlHero2
  6. UNION
  7. SELECT [ChampName] FROM [Champions] WHERE Champname=@ddlHero3
  8. UNION
  9. SELECT [ChampName] FROM [Champions] WHERE Champname=@ddlHero4
  10. UNION
  11. SELECT [ChampName] FROM [Champions] WHERE Champname=@ddlHero5)">
  12.                                         <SelectParameters>
  13.                                             <asp:ControlParameter ControlID="ddlHero2" Name="ddlHero2"
  14.                                                 PropertyName="SelectedValue" />
  15.                                             <asp:ControlParameter ControlID="ddlHero3" Name="ddlHero3"
  16.                                                 PropertyName="SelectedValue" />
  17.                                             <asp:ControlParameter ControlID="ddlHero4" Name="ddlHero4"
  18.                                                 PropertyName="SelectedValue" />
  19.                                             <asp:ControlParameter ControlID="ddlHero5" Name="ddlHero5"
  20.                                                 PropertyName="SelectedValue" />
  21.                                         </SelectParameters>
  22.                                     </asp:SqlDataSource>
  23.  
  24. END CODE
  25. -----------
  26. This process is repeated another 4 times with different queries for each DDL, but the procedure is identical.
clone this paste RAW Paste Data