简体   繁体   中英

i want to create a class from fields of dynamic form so that i can create corresponding table in sqlite dynamically

i want to create a class from fields of dynamic form so that i can create corresponding table in sqlite dynamically.

i an generating the form based on xml file. after i capture data i want to save those data into sqlite database. But since i am not sure what fields will be there in form, i can't create database. so i thought of creating database dynamically based on form fields but for that i need a class having the form fields as data which will be passed to the method which will create the table.

here is advice, create the database before touching to any anything else along with the table with possible column you might require and keep default value to null. that way you have to only update the data in table you get from the form.

You would have to come up with a way to recognizing which columns to update, this looks cumbersome but will help you if you plan on updating your app or even while making changes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM