ASP.NET ~ SqlDataSource + SelectParameters

想不到SqlDataSource 就內建這麼好用的東西了= =


<asp:SqlDataSource ID="sql4x4" runat="server"
ConnectionString="<%$ ConnectionStrings:ibuypowerConnectionString %>"

SelectCommand="SELECT blablablablablablablablablablablablablabla
WHERE BlockID = @BlockID " >
<SelectParameters>
<asp:QueryStringParameter DefaultValue="1" Name="BlockID"
QueryStringField="b" />
</SelectParameters>
</asp:SqlDataSource>

沒有留言: