RowFilter Question

  • Thread starter Thread starter Ron Ward
  • Start date Start date
R

Ron Ward

In SQL Server, I can have the following statement:

select * from MyTable where (MyColumn & 0x0001) = 1

Basically any row with a 1 or a 3 in the MyColumn will return on this call.
If I load the entire table into a DataTable object and then attempt this
same filter by setting the RowFilter property:

oDataTable.DefaultView.RowFilter = "(MyColumn & 0x0001) = 1";

I get an error: System.Data.SyntaxErrorException: Cannot interpret token '0'

Is the bitwise operator invalid on the RowFilter property, or do I need to
set this property differently?

Thank you in advance...-Ron Ward
 
Ron,

I don't understand why you expect that an expression (a kind of scripting on
its own) should be the same as SQL scripting?

You cannot use JScript or VBS statements too in those expressions.

Cor
 
Hi Ron,

I doubt that bitwise and operator is implemented.
To check what is supported take a look at
DataColumn.Expression Property
..net help topic.
 
Miha,

Doh,

Beside that why would the selection of columns than go in the way SQL does
it?

Cor
 
Thanks for the comments. I just believed the RowFilter would support
anything you ca put in a SQL Where clause. To this point I hadn't found
anything it wouldn't support: the LIKE clause the NOT clause and the IN
clause all work. I was just hoping that was the case but based on the
responses it appears it does not. Thanks for answering though.

-Ron
 
I hate to sound rude, but if you don't have anything helpful to contribute,
perhaps you should just remain quiet.
 
Ron,
I hate to sound rude, but if you don't have anything helpful to contribute,
perhaps you should just remain quiet.
May I ask you what is the helpful part in your message?
I was giving an reply to Miha not to you.
I thought that this was a community newsgroup to learn from each other.

Cor
 
Back
Top