Integrate data from another database using MVC within Umbraco
I am new to MVC but have created my Umbraco site within Visual studio. I have added a connection string (within my web.config file) to another SQL database that I have which contains employee details (ID Name, Job title, email, etc).
Assuming this is the correct process, I would like to add a macro (with an ID parameter) to my Rich text field that references a partial view Macro file.
This partical view Macro file would query the other SQL database and pull the record where the ID parameter matches the ID column in the database and displays the content such as name and email.
Can anybody point me in the right direction as I have tried both the MVCMusicStore and Umbraco level 2 training and can't work out how to do it?
I would just like to display the (employee) data within a rich text editor, with the idea being that editors of the pages can easily add the contact details of an employee to a page of my site but choosing a macro and entering an employee Id number.
The data actually comes from my hr team and I have no wish to edit it, just read/view it
Upon further reading would Peta Poco (not that I know how to use it yet) be the route I should be taking?
Sorry to bump this back up but I am back trying to work out how to connect and display data (not edit or delete) from a 2nd database where the rest of my site is run by the main database. I would prefer to keep this data out of the Umbraco database.
As I previously said would Peta Poco be the correct route or should I be looking at something else?
Integrate data from another database using MVC within Umbraco
I am new to MVC but have created my Umbraco site within Visual studio. I have added a connection string (within my web.config file) to another SQL database that I have which contains employee details (ID Name, Job title, email, etc). Assuming this is the correct process, I would like to add a macro (with an ID parameter) to my Rich text field that references a partial view Macro file. This partical view Macro file would query the other SQL database and pull the record where the ID parameter matches the ID column in the database and displays the content such as name and email.
Can anybody point me in the right direction as I have tried both the MVCMusicStore and Umbraco level 2 training and can't work out how to do it?
Hi David,
It's not a problem. But why do you need to access to another database from view ?
David, do you need to actually do anything with the data, or just display it?
I would just like to display the (employee) data within a rich text editor, with the idea being that editors of the pages can easily add the contact details of an employee to a page of my site but choosing a macro and entering an employee Id number.
The data actually comes from my hr team and I have no wish to edit it, just read/view it
Upon further reading would Peta Poco (not that I know how to use it yet) be the route I should be taking?
Sorry to bump this back up but I am back trying to work out how to connect and display data (not edit or delete) from a 2nd database where the rest of my site is run by the main database. I would prefer to keep this data out of the Umbraco database. As I previously said would Peta Poco be the correct route or should I be looking at something else?
Any help would be appreciated.
is working on a reply...