0
DataContext 개체의 ExecuteQuery 메서드를 호출하고 있습니다. 결과적으로 각 행에 대해 String과 Integer가 필요하지만 ToList 함수를 실행할 때 모든 값은 0이고 0입니다. 내 결과는 문자열과 숫자가 달라야합니다. 직접 실행하면 쿼리가 완벽하게 실행되지만 ExecuteQuery는 유효한 결과 대신 가비지를 반환합니다. 이것의 원인이 무엇일까요?ASP.NET DataContext 문제
미리 감사드립니다.
편집 :
public function something as List(of Pair(of String, Integer))
Dim c As TTDataContext = ContextFactory.CreateDataContext()
Dim startValueLen = CStr(StartValue).Length
Dim query As String = "select top " & CStr(Limit) & " case " &
" when WONum like '0000%' then SUBSTRING(WONum, 5, Len(WONum) - 4) " &
" when WONum like '000%' then SUBSTRING(WONum, 4, Len(WONum) - 3) " &
" when WONum like '00%' then SUBSTRING(WONum, 3, Len(WONum) - 2) " &
" when WONum like '0%' then SUBSTRING(WONum, 2, Len(WONum) - 1) " &
" else WONum " &
" end as retVal, " &
" case " &
" when WONum like '0000%' then 1 " &
" when WONum like '000%' then 2 " &
" when WONum like '00%' then 3 " &
" when WONum like '0%' then 4 " &
" else LEN(WONum) " &
" end as retLen " &
" from TblWorkOrder " &
" where CompanyID = " & CStr(CompanyID) & " and LEN(WONum) >= " & CStr(startValueLen) & " and (WONum > '" & CStr(StartValue) & "' or LEN(WONum) > " & CStr(startValueLen) & ") " &
" order by retLen, retVal"
Dim temp = c.ExecuteQuery(Of Pair(Of String, Integer))(query)
Return temp.ToList
End Function
아마도 코드를 보여줄 수 있습니까? 어떻게 내가 이걸 대답하리라고 기대하니 ??? – Pleun
코드를 게시 할 수 있습니까? –
귀하의 의견을 주셔서 감사합니다, 내 질문은 약 1500 문자 때문에 postet 아주 간단한 코드를했습니다. –