Error while selecting a row from datatable

155 Views Asked by At

filteredrows = Server_Tables[i].Select("(TRIM(Tool Stored Place and Sheduled)='" + searchtext + "') OR (TRIM(Workgroup server to connect to dataset within the tool)='" + searchtext + "')");

while executing, i am getting "Syntax error: Missing operand after 'Stored' operator."

1

There are 1 best solutions below

0
Steve On

It seems a bit weird, but if you really have two columns named as above then your expression should be:

filteredrows = Server_Tables[i].Select("TRIM([Tool Stored Place and Sheduled])='" + 
      searchtext + "' OR TRIM([Workgroup server to connect to dataset within the tool])='" + 
      searchtext + "'");

And this only if your searchtext variable doesn't contain any single quote.
The square brackets around the column names are required due to the presence of spaces in column names