I spent quite awhile yesterday trying to determine why my code kept exploding calling SetData.
I did not properly create the columns and it was totally my overlooking it.
However, would it be possible to check the Columns list in the CreateTable procedure to just return if the count is 0 or throw an exception in future versions?
I found the 'CREATE TABLE" error thrown by the sql call to be very ambiguous.
Until Erel gets back to you with a more plausible answer, you can always check the number of B4XTable columns before applying the data list to it:
B4X:
If B4XTable1.Columns.Size =0 Then
MsgboxAsync("Did you forget to create the B4XTable Columns", "B4XTable columns may be missing")
Return
End If
B4XTable1.SetData(Data)
Or trap the error:
B4X:
Try
B4XTable1.SetData(Data)
Catch
Log(LastException.Message)
MsgboxAsync("Did you forget to create the B4XTable Columns", "B4XTable columns may be missing")
End Try
Until Erel gets back to you with a more plausible answer, you can always check the number of B4XTable columns before applying the data list to it:
B4X:
If B4XTable1.Columns.Size =0 Then
MsgboxAsync("Did you forget to create the B4XTable Columns", "B4XTable columns may be missing")
Return
End If
B4XTable1.SetData(Data)
Or trap the error:
B4X:
Try
B4XTable1.SetData(Data)
Catch
Log(LastException.Message)
MsgboxAsync("Did you forget to create the B4XTable Columns", "B4XTable columns may be missing")
End Try