Copied to clipboard

Flag this post as spam?

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


  • jaygreasley 416 posts 403 karma points
    Aug 29, 2009 @ 10:49
    jaygreasley
    0

    Custom sections - can they access a different database to the core Umbraco db?

    Hi there,

    I've had a look through the forum and can't find an answer to this but please don't shoot me if I didn't find the obvious.

    The recent .tv videos and some blogposts got me thinking of an application using a custom section for admin and a user control for front end render.

    The question is can the custom section access a separate database and if so, how? 

    tia

    jay

  • Comment author was deleted

    Aug 29, 2009 @ 11:35

    Sure Jay that's possible.

    You just won't be able to use the datalayer (since that uses the default connectionstring)

    So just add a new connection string and run your queries on that one.

  • jaygreasley 416 posts 403 karma points
    Aug 29, 2009 @ 11:40
    jaygreasley
    0

    cool, I thought that may be the case.

    cheers Tim

    Jay

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 29, 2009 @ 17:19
    Dirk De Grave
    0

    Jay, you could still use the core datalayer code, just construct a SqlServerHelper (or MySqlHelper) (feed it with your own connection string which you can add to the web.config) and you've got the same functionality as the 'umbraco core' SqlHelper

    Both SqlServerHelper and MySqlHelper are derived from the abstract SqlHelper which implements the ISqlHelper interface

     

    I've done it in another project of mine and that worked flawlessly.

     

    Cheers,

    /Dirk

  • jaygreasley 416 posts 403 karma points
    Aug 30, 2009 @ 10:58
    jaygreasley
    0

    Hey Dirk,

    Cool, even better. cheers

    Jay

Please Sign in or register to post replies

Write your reply to:

Draft