Best way to display data from an external database?

Jaroslav Šebok asked on November 22, 2016 12:52

I want to display a link for every row loaded from an external database table. It will be a link to an existing page (in Kentico) based on ID of the loaded row.

What is the best way to implement this? One way I can think of is to create a custom table in kentico and update it (using synonyms) in the external database every time a change occurs.

Is there any other simpler way?

Correct Answer

Brenden Kehren answered on November 22, 2016 21:22

As Jan mentioned, use the SQL datasource and combine it with a custom page type which does not hold content. This way when you use your datasource and connect it to a repeater you can set the transformations for it. You can even place your custom queries in that custom page type too and call them using a repeater with a custom query. Just be sure your connection string is in the web.config file.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on November 22, 2016 15:20

I guess it very specific to your system, I am not quite sure that I fully understand the situation. Every time when a change happens in the external DB you want to update a custom table related to it in Kentico? I would probably do it with one page with routes (instead of creating pages for each record) and a linked server, if it is possible.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on November 22, 2016 15:37

If the linking doesn't change (be careful of staging and production environments, IDs change, GUID and CodeNames don't so it's better to use those), i would just use a Repeater with Custom Query, or a Custom Table Repeater, and as you display the rows using a transformation add your link logic.

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on November 22, 2016 16:52

There is the SQL data source web part that allows you connect to completely different database using your credentials on connection string.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.