0
我最後的問題不清楚。我試圖在VB.net中創建Web服務是他們的一種方式,我可以返回我從LINQ獲得的結果。即「返回objreturnLINQResults」 我試圖設置我的公共函數GetAlarmsByGUIS(BYVAL DeptGUID作爲字符串,BYVAL IDNumber作爲字符串)作爲Linq.DataContext。我只是不斷收到錯誤。請幫助。vb.net Web服務器LINQ到SQL返回
Public Function GetAlarmsByGUIS(ByVal DeptGUID As String, ByVal IdNumber As String) As Linq.DataContext
Dim lqAlarms As New linqAlarmDumpDataContext
Dim Temp As String = ""
Dim n As Integer = 0
Dim GetAlrms = From r In lqAlarms.AlarmDrops _
Where r.DeptGUID = DeptGUID And Not r.AlarmsHandled.Contains(IdNumber) _
Order By r.TimeDate Descending _
Select r
Return GetAlrms
End Function
好吧,如果我返回一個數組我該如何設置函數? Ex Public Function GetAlarmsByGUIS(ByVal DeptGUID As String,ByVal IdNumber As String)As Array它也只是錯誤。對於成爲dum的問題感到抱歉,但是對於web服務來說是新的。 – Ghsotwalker42
你必須這樣寫 - Public Alarm GetAlarmsByGUIS(ByVal DeptGUID As String,ByVal IdNumber As String)As AlarmDrop []。我不確定AlarmDrop類型,它必須是來自linq查詢的r - 變量的類型。祝你好運! – IceN