"Missing operand before '=' operator" error in DataTable filtering

alice123

New member
Joined
Nov 21, 2007
Messages
1
I have a DataTable with ColumnName: ++CustomerName++.
when i try to filter this DataTable as

string columnName=Table.Columns["++CustomerName++"].ToString();
DataRow[] row = Table.Select(columnName + " = Alice);

I am getting the above error.

I feel that because the column name is containing + sign, I am getting this error. If the column name does not contain + sign then the filtering is working fine for me.

My requirement is to have any number of + signs in the column name.

Please suggest a way out.
 
Try to get Collumn by index instead.

and after this

DataRow[] row = Table.Select("["+ columnName + "]" + " = Alice);
 
Last edited by a moderator:
Back
Top