T tamba sylvester Member Licensed User Longtime User Apr 4, 2019 #1 is it possible to set value of a given cell in b4xtable
Erel B4X founder Staff member Licensed User Longtime User Apr 4, 2019 #2 See this example: https://www.b4x.com/android/forum/t...table-table-and-export-to-csv.102847/#content Upvote 0
See this example: https://www.b4x.com/android/forum/t...table-table-and-export-to-csv.102847/#content
T tamba sylvester Member Licensed User Longtime User Apr 4, 2019 #3 thanks, this worked Code: 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
thanks, this worked Code: 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
T tamba sylvester Member Licensed User Longtime User Mar 16, 2021 #5 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: Mar 16, 2021 Upvote 0
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