Dataview rowfilter

  • Thread starter Thread starter Patrice Lamarche
  • Start date Start date
P

Patrice Lamarche

Hello Everyone!

I'm currently having trouble with a rowfilter where the name of the
column containt bracket.

Here the name of the column [Measures].[PointX]

when i sort the dataview it's ok no trouble
DataView dv = new DataView(dt);

dv.Sort = "[[Measures].[PointX]] ASC"; //it's ok working

But if I add the line it crash

dv.RowFilter = "[[Measures].[PointX]] = 0"; with the exception ..

An unhandled exception of type 'System.Data.SyntaxErrorException' occurred
in system.data.dll

Additional information: Cannot interpret token ']' at position 21.

Anyone know a workaround?

Thanks you

Best Regards,

Patrice Lamarche
 
Why do you use double brackets?
Alsom you don't table name as dataview is view on one table...
 
Hello,
I used the bracket because the server return name with bracket. And i dont
understand your second phrase.



Miha Markic said:
Why do you use double brackets?
Alsom you don't table name as dataview is view on one table...

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Patrice Lamarche said:
Hello Everyone!

I'm currently having trouble with a rowfilter where the name of the
column containt bracket.

Here the name of the column [Measures].[PointX]

when i sort the dataview it's ok no trouble
DataView dv = new DataView(dt);

dv.Sort = "[[Measures].[PointX]] ASC"; //it's ok working

But if I add the line it crash

dv.RowFilter = "[[Measures].[PointX]] = 0"; with the exception ..

An unhandled exception of type 'System.Data.SyntaxErrorException'
occurred in system.data.dll

Additional information: Cannot interpret token ']' at position 21.

Anyone know a workaround?

Thanks you

Best Regards,

Patrice Lamarche
 
Patrice Lamarche said:
Hello,
I used the bracket because the server return name with bracket. And i dont
understand your second phrase.

If Measures.PointX means Table.Column then Table prefix is not necessary as
DataView is set over Table.
What is the actual column name in dataset?
 
Hello,

well the table is call table1 ... dans the name of the column is
"[measures].[PointX]"

if a flattened cellset from analysis service

but i worked it around by renaming the column before doing operation.

thanks

Patrice Lamarche
 
Back
Top