Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I got error at <%= this.sno %>
C#
<asp:SqlDataSource ID="MONTHLYPAY" runat="server" ConnectionString="<%$ ConnectionStrings:STUDENTConnectionString %>" 
 SelectCommand="SELECT A.STU_ID,  B.PAY_TYPE,  B.PAID_DATE FROM STUDENT AS A INNER JOIN MPINFO AS B ON A.SNO = B.STU_SNO AND A.STU_ID = <%= this.sno %> ORDER BY B.PAID_DATE">
Posted
Updated 10-Aug-13 3:38am
v2
Comments
adriancs 10-Aug-13 9:35am    
Wat de error msg?

1 solution

You can try like below.

XML
<asp:SqlDataSource ID="ProductsFilteredByPriceDataSource" runat="server"
    ConnectionString="<%$ ConnectionStrings:NORTHWNDConnectionString %>"
    SelectCommand=
        "SELECT ProductName, UnitPrice
        FROM Products WHERE UnitPrice <= @MaximumPrice">
    <SelectParameters>
        <asp:ControlParameter ControlID="MaxPrice" Name="MaximumPrice"
            PropertyName="Text" />
    </SelectParameters>
</asp:SqlDataSource>


For more info :

Using Parameterized Queries with the SqlDataSource

http://www.asp.net/web-forms/tutorials/data-access/accessing-the-database-directly-from-an-aspnet-page/using-parameterized-queries-with-the-sqldatasource-cs[^]

SOF

http://stackoverflow.com/questions/5853660/using-variables-in-sql-queries-in-asp-net-c[^]


I hope this will help to you.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900