RobRock92 Member Licensed User Longtime User Nov 28, 2013 #1 how do I insert data from EditText with a button in the database using dbutils?
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2013 #2 Something like: Code: Copy Dim m As Map m.Initialize m.Put("col1", EditText1.Text) DBUtils.InsertMaps(SQL, "Table1", Array as Object(m)) Note that if you need to insert multiple rows then you should add them to a list and insert them in a single call. It is much (100x) faster than inserting them one by one. Upvote 0
Something like: Code: Copy Dim m As Map m.Initialize m.Put("col1", EditText1.Text) DBUtils.InsertMaps(SQL, "Table1", Array as Object(m)) Note that if you need to insert multiple rows then you should add them to a list and insert them in a single call. It is much (100x) faster than inserting them one by one.
RobRock92 Member Licensed User Longtime User Nov 28, 2013 #3 out this error in log: Code: Copy InsertMaps (first query out of 1): INSERT INTO [clienti] ([Id]) VALUES (?) Upvote 0
out this error in log: Code: Copy InsertMaps (first query out of 1): INSERT INTO [clienti] ([Id]) VALUES (?)
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2013 #4 This is not an error. DBUtils prints the queries in the logs. Upvote 0
RobRock92 Member Licensed User Longtime User Nov 28, 2013 #5 ah ok, and how put this in the table? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2013 #6 DBUtils.InsertMaps inserts the data to the database and prints the first query to the logs. You can see how it is implemented. It is not too complicated. Upvote 0
DBUtils.InsertMaps inserts the data to the database and prints the first query to the logs. You can see how it is implemented. It is not too complicated.
RobRock92 Member Licensed User Longtime User Nov 28, 2013 #8 Erel one last thing, how do I delete a record that I have selected from a combobox? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2013 #9 You can add the DeleteRecord sub that I posted here (to DBUtils module): http://www.b4x.com/android/forum/th...tabases-are-now-simple.8475/page-2#post-60395 Upvote 0
You can add the DeleteRecord sub that I posted here (to DBUtils module): http://www.b4x.com/android/forum/th...tabases-are-now-simple.8475/page-2#post-60395