Inserting data to the sql database in smartface

381 Views Asked by At

In my project, dynamically i want to insert any type of data to sql table in smart. I already have a dataset (its connected to a repeatbox). And then listing them into the repeatbox. Just searching any example or snippet to understand how it works.

After inserting the data, will repeatbox show all table items immediately in repeatbox?

1

There are 1 best solutions below

1
On BEST ANSWER

You can do this in 2 ways:

  1. Can insert data with "Data.execute()" method (manual). You should put your query and arguments as parameter. First parameter must your sql query. Do not forget notifying your dataset to show your data in repeatbox.
  2. Can use dataset to insert or remove data in the tables. It is simple and works like in Classic ASP. Do not forget applying changes (commit) and notifying dataset to show your data in repeatbox.

It will not shown immediately unless you notify dataset. Here is an example.

Data.Dataset1.add(); //create a new row
Data.Dataset.ColumnName1 = "Hello World!"; //set the column value
Data.commit(); //write them to the database
Data.notify("Data.Dataset1");