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 4908 posts 12265 karma points MVP 5x 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 863 posts 3849 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 863 posts 3849 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 4026 posts 15836 karma points MVP 13x 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.

Please Sign in or register to post replies

Write your reply to:

Draft