[問題] 如何使用特殊字元在Linq Query?
請教一下,如何在Linq query中使用特殊字元?
舉例:
var q = (from p in dataServiceManager.getDataService().XXXX
where p.field1 == "TEST.TEST"
select p).First();
上面這個例子在執行時會出現DataServiceRequestException.
原因應該是出在"TEST.TEST"中有(.)出現(我猜想的)
如果我的資料有這類的特殊字元存在,我要怎麼修改where條件才能query得到?
補上error message
HTTP 404.
您要尋找的資源 (或其相依性的其中之一)
可能已經移除、名稱已經變更或是暫時無法使用。
請檢閱下列 URL,並且確定它的拼寫無誤
要求的 URL: /EntityDataService.svc/XXXX('TEST.TEST')
版本資訊: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.272
[HttpException]: 檔案不存在。
於System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response)
於 System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath)
於 System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
於 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
於 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.222.153.62
→
05/25 12:30, , 1F
05/25 12:30, 1F
→
05/25 13:12, , 2F
05/25 13:12, 2F
→
05/25 13:42, , 3F
05/25 13:42, 3F
→
05/25 13:43, , 4F
05/25 13:43, 4F
→
05/25 13:46, , 5F
05/25 13:46, 5F
→
05/25 13:47, , 6F
05/25 13:47, 6F
已修正
※ 編輯: tong1219 來自: 61.222.153.62 (05/25 13:54)
→
05/25 13:54, , 7F
05/25 13:54, 7F
→
05/25 13:55, , 8F
05/25 13:55, 8F
→
05/25 13:56, , 9F
05/25 13:56, 9F
→
05/25 13:56, , 10F
05/25 13:56, 10F
→
05/25 13:57, , 11F
05/25 13:57, 11F
→
05/25 13:58, , 12F
05/25 13:58, 12F
→
05/25 14:04, , 13F
05/25 14:04, 13F
※ 編輯: tong1219 來自: 61.222.153.62 (05/25 14:08)
→
05/26 12:52, , 14F
05/26 12:52, 14F
→
05/26 12:53, , 15F
05/26 12:53, 15F
→
05/26 12:53, , 16F
05/26 12:53, 16F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章