how to get data from database to store a dynamic table using web method

how to get data from database to store a dynamic table using web method

Client side code can’t interact directly with database, so you will need to kind some kind of script ( php, nodejs, java, .net, python - anything ) that will take data from db and output it as xml or as json. After that you can use url of such script in component configuration.