Android Question update cell value b4xtable

Status
Not open for further replies.

tamba sylvester

Member
Licensed User
Longtime User
thanks,
this worked


B4X:
Sub SetValue (tbl As B4XTable, RowId As Long,value As String)
    tbl.sql1.ExecNonQuery2($"UPDATE data SET ${column.SQLID} = ? WHERE rowid = ?"$, Array As String(value, RowId))
    'updates the specific cell data
    B4XTable1.Refresh
End Sub

note
column is b4xtable column
value is data to be passed
 
Upvote 0

LUISTORRES

Member
Licensed User
fired error
1615863573712.png
 
Upvote 0

tamba sylvester

Member
Licensed User
Longtime User
Make sure you define the column that you want to update.

B4X:
'Define column
Private Amount As B4XTableColumn

'Initialize column
Amount=B4XTable1.AddColumn("Amount", B4XTable1.COLUMN_TYPE_text)

Then this how it will be
B4X:
Sub SetValue (tbl As B4XTable, RowId As Long,value As String)
    tbl.sql1.ExecNonQuery2($"UPDATE data SET ${Amount.SQLID} = ? WHERE rowid = ?"$, Array As String(value, RowId))
    'updates the specific cell data
    B4XTable1.Refresh
End Sub
 
Last edited:
Upvote 0
Status
Not open for further replies.
Top