tags:

views:

25

answers:

1

I have web service which returns a datatable with the following column name:

Id@qb>type

I am applying the following filter statement to this datatable:

[Id@qb>type] IN (0, 1, 2, 3, 4)

But whenever I use this column name in the filter statement it throws the following exception:

Invalid column name 'Id@qb>type'.

Thanks.

A: 

I'm not sure exactly how you're using the column, but I can think of two possible solutions:

1) Refer to the column by index instead of name.

2) Modify the procedure you're using to fill your Datatable so that it uses an alias for that column which is more code-friendly.

AllenG
Just to rephrase the question in a different way. What if I have a Database containing a column named "Id@qb>type". Then how would i be able to SELECT this column (assume the column name cannot be changed)?
Ramiz Uddin
@Ramiz Uddin - I'm a fan of stored procedures for all calls from code. You can always alias the column name in a stored proc.
AllenG