We help IT Professionals succeed at work.

How to use acos, cos, sin functions in asp.net DataView.RowFilter

lenguyen0366 used Ask the Experts™
I need to do some distance calculation given the latitude and longitude.  When I put the calculation in the stored procedure, the calculation works fine, but when I need to put that calculation in the DataView.RowFilter, those functions are not recongnized even though I have System.Math name space imported.  Is it possible to use acos, cos, and sin functions in DataView.RowFilter?

Thank you
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
What error do you get? What does your code look like? I am guessing here but does ur rowfilter combine both strings and int's? If so you will get cannot perform operation on System.Int32 and System.String. The fix for that is converting your int's to strings like so System.Convert.ToString(integer_here).
Most Valuable Expert 2012
Top Expert 2014

RowFilter supports very limited functionality.

Here is explanation of what is supported in RowFilter



Thank you for your replies.  I think CodeCruiser is right.  RowFilter in DataView just supports some functionalities.  I will try DataTable.Select to see if that will do it.  If not, I probably have to go back to doing the calculation inside the stored procedure and let sql server handles the job.  


I got it worked out.  Thank you all for your replies.