Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello experts

Row filter of datable
C#
Dim i As Int16 = Convert.ToInt32(Dt.Rows(Dt.Rows.Count - 1)("Column1"))
  dv.RowFilter = "Total<='" + i + "'"


i is an integer value but the above statement throws me error input string was not in correct format.
However,
dv.RowFilter = "Total<=8"


This statement works perfectly fine. why not with i Could someone please tell the solution
It must be something very simple but nothing is top of my head now

What I have tried:

Row filter of databale with values hard coded or static values ...
Posted
Updated 30-Mar-16 3:38am

1 solution

Take out the quotes!
VB
dv.RowFilter = "Total<=" + i.ToString()
 
Share this answer
 
Comments
sudevsu 30-Mar-16 9:44am    
Seriously... I knew it its very simple. Silly me... Thank Griff :)
OriginalGriff 30-Mar-16 9:47am    
You're welcome!

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