Dataview rowfilter

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
 
M

Miha Markic [MVP C#]

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

Patrice Lamarche

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
 
M

Miha Markic [MVP C#]

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?
 
P

Patrice Lamarche

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top