Copied to clipboard

Flag this post as spam?

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


  • Anton 135 posts 186 karma points
    Feb 29, 2012 @ 12:35
    Anton
    0

    How I can get connection string by API?

    How I can get connection string by API?

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Feb 29, 2012 @ 12:39
    Jeroen Breuer
    2

    You can get it with this code:

    ConfigurationManager.AppSettings["umbracoDbDSN"]

    Jeroen

  • Anton 135 posts 186 karma points
    Feb 29, 2012 @ 12:45
    Anton
    0

    Thanks

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    Feb 29, 2012 @ 12:53
    Hendy Racher
    1

    (or umbraco.BusinessLogic.Application.SqlHelper.ConnectionString)

  • Anton 135 posts 186 karma points
    Feb 29, 2012 @ 12:54
    Anton
    0

    Is there a difference?

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    Feb 29, 2012 @ 12:56
    Hendy Racher
    0

    don't think so, both should return the same string

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Feb 29, 2012 @ 13:22
    Lee Kelleher
    0

    or umbraco.GlobalSettings.DbDSN ... again no difference, but good to keep in mind that you have strongly-typed access to all the appSettings keys from the umbraco.GlobalSettings API.

    Cheers, Lee.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies