Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Tregoning 63 posts 236 karma points
    Sep 22, 2014 @ 15:52
    David Tregoning
    0

    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?

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Sep 22, 2014 @ 20:11
    Alex Skrypnyk
    0

    Hi David,

    It's not a problem. But why do you need to access to another database from view ?

  • Amir Khan 1284 posts 2741 karma points
    Sep 22, 2014 @ 20:29
    Amir Khan
    0

    David, do you need to actually do anything with the data, or just display it?

  • David Tregoning 63 posts 236 karma points
    Sep 22, 2014 @ 23:26
    David Tregoning
    0

    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?

  • David Tregoning 63 posts 236 karma points
    Jan 26, 2015 @ 17:21
    David Tregoning
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft