it is urgent :- with Connection String Problem

Last post 09-29-2008, 5:20 AM by patriwala. 2 replies.
Sort Posts: Previous Next
  •  09-08-2008, 2:38 AM Post number 69447

    it is urgent :- with Connection String Problem

    Hi Every one,

        I regarding connectionString problem, I have two database. In one database old information details are stored and another database it is current information. But the Web application is one. if i want to retrieve the old information when ever the use want. But my web application using one connectionstring it is current Database connectionString.

       So how can i retrieve the old information when ever the user want.

      

     

    regds

    sbk.net

     

       

  •  09-10-2008, 11:06 PM Post number 69478 in reply to post number 69447

    • Damon is not online. Last active: 12-02-2008, 6:48 PM Damon
    • Top 10 Contributor
    • Joined on 06-26-2006
    • Dallas, TX
    • Acorn Archimedes

    Re: it is urgent :- with Connection String Problem

    Option 1:

    Deploy your application to two different locations.  Use the connection string to the old data in one location.  Use the connection string to the new data in the other location.  Users can then go to the appropriate location and look up information.

    Option 2:

    Merge the data from both database into a single database.  I'm not sure what your structure looks like, so this may not be feasible.

    Option 3:

    Start coding and make your application use both connection strings.  One for when users want the new data and the other for when they want the old.


    Damon Armstrong, Technology Consultant
    [Blog] [Articles]
  •  09-29-2008, 5:20 AM Post number 69752 in reply to post number 69447

    Re: it is urgent :- with Connection String Problem

    hi sbk,
    you can do one thing identify where you want to use old database and new database. after in the application put both connection string in the webconfigfile.

    1) old connection string
    <add name="Connection String" connectionString="server=Server;uid=UserID;pwd=PWS;database=DB1" providerName="System.Data.SqlClient"/>
    2) new connection string
        <add name="Connection String1" connectionString="server=Server;uid=UserID;pwd=PWS;database=DB2" providerName="System.Data.SqlClient"/>

    you can access this connection as that location.like in the old database you can use the connection string
     string oldcon = ConfigurationManager.ConnectionStrings["Connection String"].ConnectionString; and in the new database use string newcon = ConfigurationManager.ConnectionStrings["Connection String1"].ConnectionString;

    thnx


    Amit S Patriwala
    http://amitpatriwala.wordpress.com
View as RSS news feed in XML