saurabh goyal
saurabh goyal

Reputation: 1744

Filter expression in Sqldatasouce

I have a sqldatasource where i have added a simple filter expression just for testing

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                SelectCommand="SELECT * FROM [project_details]" 
                FilterExpression="id=33" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                EnableCaching="True">

and a grid view in update panel which has datasource as sqldatasouce1 . but on executing this page grid view is showing all the result withour any filtering . please help me i am totally struck here

Upvotes: 1

Views: 430

Answers (1)

Mamta D
Mamta D

Reputation: 6460

If the id is stored in text format then you might want to give single quotes in the expression as shown here:

id='33'

Upvotes: 1

Related Questions