Typed Datasets and Connection Strings from Machine.Config

Last post 11-13-2006 11:15 PM by Gordon-Freeman. 1 replies.

Sort Posts:

  • Typed Datasets and Connection Strings from Machine.Config

    11-08-2006, 7:42 AM
    • Loading...
    • kristoferhoch
    • Joined on 11-06-2006, 1:58 PM
    • Texas
    • Posts 1

    Hello,

    Thank you in advance for taking the time to read and possibly respond to this posting.  I have an issue with the way the ConnectionString is retrieved from withing an XSD file.  It currently will only take the ConnectionString from the Web.Config.  Generally this isn't a bad thing, but we have Three different databases and servers for: Development, Testing, Production.  Each of the Databases have a different name and are accessed from different deployment servers (Development, Test, and Production servers.) 

    We wanted to put the ConnectionString in the Global Assembly on each of the Deployment servers. The problem that we are finding is that the XSD file will only get ConnectionStrings from the Web.Config, and not the Machine.Config.  Is there a solution to this problem?  We can't find any documentation on how to deal with this issue.

     
    FYI: Manually changing the Web.Config is not an option because of our source control.  It enforces that changes can only be made on the development deployment server.


    Sincerely,

    Kristofer Hoch

     

  • Re: Typed Datasets and Connection Strings from Machine.Config

    11-13-2006, 11:15 PM

    Emm.. If you can ask the man at the server to copy some extra config file into your app, you may try configSource attribute.

    Go Here and search for configSource you will get the idea~

    And if you view the XSD's code you will see the connection is specified only in web.config, some what similar to:

            <Connections>
              <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="NORTHWNDConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="NORTHWNDConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.NORTHWNDConnectionString.ConnectionString" Provider="System.Data.SqlClient">
              </Connection>
            </Connections>

    I'm not familiar with its schema, but you can try changing it to machine.config Idea

    你好! Just FYI o_O
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter