簡體   English   中英

從數據表中選擇一行時出錯

[英]Error while selecting a row from datatable

filteredrows = Server_Tables [i] .Select(“((TRIM(工具存放和放置)='” + searchtext +“')OR(TRIM(工作組服務器以連接到工具內的數據集)='” + searchtext +“' )“);

執行時,我收到“語法錯誤:'存儲'運算符后缺少操作數”。

看起來有點怪異,但是如果您確實有兩個如上所述的名稱,那么您的表達式應該是:

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

僅當您的searchtext變量不包含任何單引號時,才使用此選項。
由於列名中存在空格,因此必須在列名周圍加上方括號

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM