在过滤前Sqldatasouce pression [英] Filter expression in Sqldatasouce

查看:206
本文介绍了在过滤前Sqldatasouce pression的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在那里我已经添加了一个简单的过滤器前pression只是为了测试一个SqlDataSource

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">

和更新面板网格视图里面有数据源作为sqldatasouce1。但在执行此页网格视图中显示所有结果全无任何过滤。请帮助我,我完全打在这里

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

推荐答案

如果该ID存储在文本格式,那么你可能想给在EX pression单引号,如下所示:

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

ID = '33'

这篇关于在过滤前Sqldatasouce pression的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆