Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > BindingSource.Filter and Bitwise Operation
 

BindingSource.Filter and Bitwise Operation

Is it possible to perform a Bitwise Operation on the BindingSource.Filter

So far it seems apparently not, but i'm trying to find out if there is another way to go about the filter on a bitflagged column.

Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
"Never Trust a computer. Your brain is smarter than any micro-chip."
JaedenRuiner  Wednesday, September 09, 2009 9:52 PM
Hello,

As far as I know, the filter can support the following format string
[column name] [operation] [value1] or/and [column name] [operation] [value2] ect.
The "&" option won't be supported.

Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
  • Marked As Answer byJaedenRuiner Wednesday, September 16, 2009 1:24 PM
  •  
Kira Qian  Wednesday, September 16, 2009 9:23 AM
Hi JaedenRuiner,

BindingSource.Filter only support to be set with a string. That string represent the filter logical. I don't know what kind of bitwise do you want to operate. Could you please explain it with example?

Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework!
Kira Qian  Monday, September 14, 2009 5:30 AM
Ah, yes. um:

SQL Server SQL Statement is:

Select *
from MyBitTable
where ((Bits & 24) > 0)

24 being bit 4 (16) and bit 3 (8) are set. looking roughly like: 00011000

Thus, my tested equations of:

BindingSource.Filter = "(Bits & 24) > 0"
BindingSource.Filter = "(Bits AND 24) > 0"

Both fail, so I'm wondering if there is another notation or if the operation just isn't supported by the BindingSource Class.
THanks
J"SD"a'RR

"Never Trust a computer. Your brain is smarter than any micro-chip."
JaedenRuiner  Monday, September 14, 2009 8:56 PM
Hello,

As far as I know, the filter can support the following format string
[column name] [operation] [value1] or/and [column name] [operation] [value2] ect.
The "&" option won't be supported.

Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
  • Marked As Answer byJaedenRuiner Wednesday, September 16, 2009 1:24 PM
  •  
Kira Qian  Wednesday, September 16, 2009 9:23 AM

You can use google to search for other answers

Custom Search

More Threads

• Getting current row
• using the richtextbox in a datagridview?
• somebody plz help
• DataGridViewTextBoxColumn & DateTime !
• How to leave a DataGridView (TextBoxColumn) in edit mode when switch to a modeless from?
• dropdownlist + textbox + Msaccess
• C# unbound calculated textbox
• DataGridViewRow not responding to property change
• dataview in a listbox
• Database connection to SQL server through VB(Windows appliatioon VS 2005)