There are two main methods for getting data out of Excel; GetCellValue and ExportData.
GetCellValue gets a single cell's value
ExportData creates a DataTable representing the range of cells specified.
Your insert query into your database would dictate which method you'd need to use depending on how it accepts the data to be inserted. An example would be difficult to provide since it would also require setup of a corresponding database.
Could you share the screenshot of the automation window and also db config settings screenshot?. because i not able to find any tutorial to retrieve data from db and storing in excel. would be greatfull if you share the detailed steps with screenshots. Thanks in advance.