Copied to clipboard

Flag this post as spam?

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


  • Jinesh 33 posts 52 karma points
    Apr 30, 2011 @ 16:50
    Jinesh
    0

    Want to connect to another mssql along with umbraco db

    Hello All,

     

    I m new to Umbraco ....i have installed umbraco and its working fine ...we have made a .net user control which gets data from another mssql ...

    we tried adding connection string in the web.config of umbraco but it didnt work,,,we tried adding hardcoded connection string in the user control to test and that worked well..

    So wanted to know what could be the issue ...am i doing anything wrong or am i missing any step...?

    Please guide me.....waiting for reply....

     

    Regards,

    Jinesh

  • Lennart Stoop 304 posts 842 karma points
    Apr 30, 2011 @ 17:12
    Lennart Stoop
    1

    Hi Jinesh,

    Much depends on what you are trying to accompish with the data from the other SQL database.

    Seeing that your usercontrol works fine when hardcoding the connection string, it should also work when you add the connection string to the web.config as an additional appsetting:

    <add key="customDSN" value="server=.\SQL2008;database=database;user id=userid;password=pwd" />

    And in your usercontrol you should be able to fetch this connectionstring via the ConfigurationManager class:

    string connString = System.Configuration.ConfigurationManager.AppSettings["customDSN"];

     

     

Please Sign in or register to post replies

Write your reply to:

Draft