Datagridview
-
Hello eveybody! I have a small question need your help. My datagridview is bound with a dataset contains tblProduct table. A combox allows users choose a Product(B3700, NAPPLE 3'1, NAPPLE 3'2,...) If I filter like this
tblProductBingdingSource.Filter = "Product = 'B3700'"
. It works well If I repeattblProductBingdingSource.Filter = "Product = 'NAPPLE 3**'**2'"
, it fails to work because of existence of the quote mark. If I replace string"Product = 'NAPPLE 3'2'"
with string"Product like 'NAPPLE 3%'"
, my grid will have this list of unexpected products such as NAPPLE 3'1, NAPPEL 3'2, NAPPLE 3'3,so on. When the users choose a value from combobox such as NAPPLE 3'2, I only have an only product, NAPPLE 3'2. Please help me correct the filtering string. I know the filtering string"Product like 'NAPPLE 3%2'"
but the string is not general for all. Thanks in advance Sorry about my English.It seem to be a solution or an answer.
-
Hello eveybody! I have a small question need your help. My datagridview is bound with a dataset contains tblProduct table. A combox allows users choose a Product(B3700, NAPPLE 3'1, NAPPLE 3'2,...) If I filter like this
tblProductBingdingSource.Filter = "Product = 'B3700'"
. It works well If I repeattblProductBingdingSource.Filter = "Product = 'NAPPLE 3**'**2'"
, it fails to work because of existence of the quote mark. If I replace string"Product = 'NAPPLE 3'2'"
with string"Product like 'NAPPLE 3%'"
, my grid will have this list of unexpected products such as NAPPLE 3'1, NAPPEL 3'2, NAPPLE 3'3,so on. When the users choose a value from combobox such as NAPPLE 3'2, I only have an only product, NAPPLE 3'2. Please help me correct the filtering string. I know the filtering string"Product like 'NAPPLE 3%2'"
but the string is not general for all. Thanks in advance Sorry about my English.It seem to be a solution or an answer.