Dim cmd1 As DBCommand = CreateCommand("select_insertnianduyusuan", params) 错误: 不兼容的类型: List<Object>无法转换为Object[]
B4X:
Private Sub ShowDialog(Item As Map, RowId As Long)
Wait For (PrefDialog.ShowDialog(Item, "yes", "cancel")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Dim params As List
params.Initialize
params.AddAll(Array(Item.Get("year"),Main.bumena,"",Item.Get("xiangmu"))) 'keys based on the template json file
If RowId = 0 Then 'new row
B4XTable1.sql1.ExecNonQuery2($"INSERT INTO data VALUES("", ?, ?, ?)"$, params)
B4XTable1.ClearDataView
Dim req1 As DBRequestManager = CreateRequest
Dim cmd1 As DBCommand = CreateCommand("select_insertnianduyusuan", params)
Dim j As HttpJob = CreateRequest.ExecuteBatch(Array(cmd1), Null)
Wait For (req1.ExecuteCommand(cmd1,Null)) JobDone(j As HttpJob)
If j.Success Then
xui.MsgboxAsync("success!","")
Else
Log("ERROR (7): " & j.ErrorMessage)
End If
j.Release
Else
params.Add(RowId)
'first column is c0. We skip it as this is the "edit" column
B4XTable1.sql1.ExecNonQuery2("UPDATE data SET c1 = ?, c2 = ?, c3 = ? WHERE rowid = ?", params)
B4XTable1.Refresh
End If
End If
End Sub