473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Datasource FilterExpression fails for string fields

VS 2005
C#
ASP.NET
I have a Gridview which is filled from an objectdatasource. I have some
filtering - which works perfectly when the field to be filtered is an
INT.

dscIssues.FilterExpression += " and (assignedtoid = 1)" works ok

but if i filter on a string field is doesnt bring back any records

eg
dscIssues.FilterExpression += " and (name= 'tom')" fails

ive tried creating a FilterParamater as well, but it also fails

May 17 '06 #1
1 1790
The syntax is correct, and filter expresion does work with strings, it is
likely that you have a logical error somehwere in the code that is creating a
different filter expression than you are expecting. Have you tried filtering
for strings by simply setting the complete FilterExpression property in one
line of code, rather than adding a where clause on at a later date. If that
works OK i would get your code to output the FilterExpresion property at
various points in the code so that you can track what is causing the problem.

"j.******@ahrc.ac.uk" wrote:
VS 2005
C#
ASP.NET
I have a Gridview which is filled from an objectdatasource. I have some
filtering - which works perfectly when the field to be filtered is an
INT.

dscIssues.FilterExpression += " and (assignedtoid = 1)" works ok

but if i filter on a string field is doesnt bring back any records

eg
dscIssues.FilterExpression += " and (name= 'tom')" fails

ive tried creating a FilterParamater as well, but it also fails

May 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rob merritt | last post by:
I have a grideiw that feeds a detailView via 2 AccessDateSources the detail view has and update command that UpdateCommand="UPDATE SET = ? WHERE = " does'nt update since it doesn't...
1
by: fuchs.markus | last post by:
Hello, on my page, I have a DetailsViewControl connected to a SqlDataSource. Now when I dynamically set the FilterExpression and FilterParameters - for example in a OnClick-EventHandler of a...
2
by: DummyDumb | last post by:
Hi, I've got a Gridview utilizing a filterexpression: <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OnDeleted="ItemDeleted" EnableCaching="true"...
0
by: wubin_98 | last post by:
When I set a SqlDataSource1.FilterExpression value to " Partnumber LIKE '87-2055-___'" , SqlDataSource return empty. But I can get correct result in SQL query by including above expression. I...
1
by: mosscliffe | last post by:
I am trying to filter an accessdatsource by adding a FilterExpression If I have Field = 2 It works fine If I have Field IN (1,5,7) it works fine So now I want it to reference a...
2
by: AAJ | last post by:
I know this sounds nuts, but how do I remove the following filter from a Object Datasource that looks at my business layer... ODSDefaultUserProfiles.FilterExpression = "AllowedWebPage = '" +...
4
by: David | last post by:
I cannot get my aspx page (ASP.Net 2.0) to remove the FilterExpression on a SqlDataSource. Can someone tell me what I am doing wrong? Below is the SelectCommand: <asp:SqlDataSource...
1
by: jobs | last post by:
Cannot find column . Am I missing something here... SelectCommand="SELECT , , , refid FROM " FilterExpression="phone_nbr like @phone_nbr + '%'"
3
by: Curt | last post by:
I have a gridview object with a sqldatasource as its sourceid. Everything was going so well until I came across this problem. My SELECTCOMMAND for my sqldatasource is: select...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.