SqlDataSource SelectCommand 中oracle 的占位符 就是—— :变量
如
<asp:DropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource2" DataTextField="品牌" DataValueField="品牌" AutoPostBack="true"> </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:oracleConnetString %>" ProviderName="<%$ ConnectionStrings:oracleConnetString.ProviderName %>" SelectCommand="select DISTINCT i.品牌 FROM ytuser.ITEM_INF i where i.分销是否使用='1' and i.品牌拥有者=:品牌拥有者"> <%-- 终于被我找到oracle 的占位符啦 : --%> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="品牌拥有者" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:SqlDataSource>