Home All Groups Group Topic Archive Search About

Wildcard, filter and dataview

Author
22 Feb 2006 12:58 PM
Michael
Hello,

I am using xml files as data tables, in one i have a field named "Cours"
which represent multiple boolean field in one string field. I work with
CSharp code on VS2005.

Explanation :
i have 9 elements which can take values Yes or No, so instead of making 9
new fields in my database i made one field whith values like this :
"001001100"
I check the values with a checkedlistbox and it works fine.

Now i want to make a filter with multiple items checked.

Example, i want to check the second and the fifth characters to be equal to
1, i don't care about the others that can be 0 or 1.
I need to use simple wildcard characters. I check the help , and microsoft
only speak about * and % wildcars, that fits 1 or more characters.

So i have tried with ? and _ that work on some SQL requests depends on
database.

The Filter should be like that :
strQuery = ('??1??????' OR '????1????')     or    ('__1______' OR
'____1____')
monDS.ReadXml(System.IO.Directory.GetCurrentDirectory() + "\\Base\\" +
nomTable + ".xml", System.Data.XmlReadMode.ReadSchema);

System.Data.DataView monDV = new
System.Data.DataView(monDS.Tables[nomTable], strQuery, strSort,
System.Data.DataViewRowState.CurrentRows);

It doesn't work in my case, and i have no rows in the output of the request.

Can anyone help me ?

AddThis Social Bookmark Button