Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to use DataView RowFilter Syntax [C#]with space tag Ex: i want to filter using RowFilter Year="1427" but its showing me error (Error !Cannot find column Year ).
i discover why this message is showing because Year column has some space...

DataView dv = myDs.Tables[0].DefaultView;
dv.RowFilter = "Year=1427";
gv.DataSource = dv;
gv.DataBind();
Posted
Comments
Shanu2rick 10-Jan-13 5:31am    
And Your Problem is...?
[no name] 10-Jan-13 5:32am    
please check in your dataset what are the column names are available
Member 8194711 10-Jan-13 5:33am    
I can't Find the Year column its show me Error how can i find column its has space how can i avoid that space
Shanu2rick 10-Jan-13 5:37am    
Where is this space exactly in your Column 'Year'?
Member 8194711 10-Jan-13 5:56am    
Sir i dont know actually so there is any way to avoid the space

1 solution

Hi,

please be check in your Dataset having the column name "year" or not.

Please be check it once. If the column name is avilable in your dataset then please be check the spell and caps letters also..
 
Share this answer
 
v2
Comments
Member 8194711 10-Jan-13 5:42am    
yah i have column it called year but it has some space when i convert dataset to xml the year column its show like this <year_x0020_><year_x0020_>

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