Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 8th, 2006, 06:14 AM
Authorized User
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to anup_daware Send a message via MSN to anup_daware Send a message via Yahoo to anup_daware
Default Filtering Dataview [Strange Problem]

Abstract: I want to filter a dataview with a value where column name have a SPACE.
I bind a dataview to a datagrid,
The query which is fetching the results in Dataset is something like this:-
Select POSTAL_ADDRESS as "Postal Address" from Emp where ....
Now the column name in Dataview is "Postal Address" which is having a space, with this column name when I am filtering the Dataview like:-
DataViewAddress.RowFilter = "Postal Address LIKE '*Bel1*'"
which throws following exception:-
System.Data.SyntaxErrorException: Syntax error: Missing operand after 'Address' operator.
I tried
DataViewAddress.RowFilter = "\"Postal Address\" LIKE '*Bel1*'"
I also tried the EncodedColumnName which replaces spaces with _x0020_
DataViewAddress.RowFilter = "Postal_x0020_ Address LIKE '*Bel1*'" but nothing worked and got the same exception every time..

I searched the net but I didnt get anything on it...
Any help will be Very-Much Helpful..
Thanks and Regards,
Anup Daware

Best Regards,
<Today is the first day of your rest of life.. Make most of it>
--Everything you can imagine is real.--
Old August 8th, 2006, 07:09 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Have you tried this:

DataViewAddress.RowFilter = "[Postal Address] LIKE '*Bel1*'"


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering combobox from a dataview. Nellemandela C# 3 August 28th, 2008 02:10 PM
Problem Filtering Morteza_M Pro VB Databases 2 January 23rd, 2007 08:12 AM
Filtering Columns in dataview ramesh055 ASP.NET 1.0 and 1.1 Professional 1 November 3rd, 2006 03:51 PM
email filtering problem sanjeewa131 C# 2005 0 July 28th, 2005 06:16 AM
dataview display problem msrnivas .NET Web Services 0 August 23rd, 2004 05:30 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.