Jump to content

connecting to 2 diffrent sql servers databases from single web application


sansat6699
 Share

Recommended Posts

i am having 2 sql servers one is web sql server server and other server is my local sql server. i am making web application through which i want to connect both sql servers at a time and by selecting data from web server i want to insert it into my local sql server both having same database on which i want to work , i want to know how it can be done my idea as follows in web.config i specify 2 connection string and by selecting data from websql server database table i going to store it in dataset and then i return dataset to another function which connects to local sqlserver database.but database records are much large. can any body guide me .i am going to place my web application on local server (C# asp.net 2.0) .thank you,

Link to comment
Share on other sites

i am having 2 sql servers one is web sql server server and other server is my local sql server. i am making web application through which i want to connect both sql servers at a time and by selecting data from web server i want to insert it into my local sql server both having same database on which i want to work , i want to know how it can be done my idea as follows in web.config i specify 2 connection string and by selecting data from websql server database table i going to store it in dataset and then i return dataset to another function which connects to local sqlserver database.but database records are much large. can any body guide me .i am going to place my web application on local server (C# asp.net 2.0) .thank you,
To copy data from one database to another, I suggest you do it all in a stored procedure, not retrieve it to a dataset. If you're using MS SQL you can do this by defining a linked server in one of the SQL Servers, that links to the other one. You can then refer to the linked server in a stored procedure that gets the data across, and simply call this stored procedure from your web app.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...