1
I 내가 튜라 SQLBase와 통신 컴 DLL 이루어지는 현상이 있습니다MVC 컨트롤러 및 COM 객체 VB 닷넷
COM DLL Code
adaptor.SelectCommand() = New SQLBaseCommand("SELECT COMPANY_ID,COMPANY_NAME FROM COMPANY", myConnection)
Dim ds = New DataSet()
adaptor.Fill(ds, "COMPANY")
Dim myArray As New ArrayList
For Each row As DataRow In ds.Tables(0).Rows
myArray.Add(row)
Next
MsgBox(myArray(1).Item(0)) //This shows 102
MsgBox(myArray(1).Item(1)) //This shows Maui Mu-Mus
Return myArray
그래서 myArray
올바른 값을 저장하는 단계; 그러나 내 MVC 컨트롤러에서 23 행 (어떤 괜찮습니다) arrayList 있어요하지만 그들 모두 비어 있습니다. 여기
Controller Code GET: /Gupta/GetCiudades
Function GetCiudades() As JsonResult
Dim objConn As Object
objConn = Server.CreateObject("TestGupta.ComClass1")
Dim ciudadJson As ArrayList = objConn.getCompanies()
Return Json(ciudadJson, JsonRequestBehavior.AllowGet)
End Function
Ajax Code
입니다 :
$.getJSON("Gupta/GetCiudades", null, function (ciudades) {
ciudades = (JSON.stringify(ciudades));
console.log(ciudades);
});
console.log Result:
[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]
질문입니다 : 왜의 오른쪽 값을 보여주고있다 COM 개체의 경우 컨트롤러 행이 비어 있습니다 ??
그래서 myArray는 올바른 값을 저장합니다. 그러나 내 MVC 컨트롤러에서 23 행 (어떤 괜찮습니다) arrayList 있어요하지만 그들 모두 비어 있습니다 .... 왜 ?? – Hackerman