Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
we have two asp.net web applications..two websites have two different sql databases...we must be able to access website1 data from website2

how can i do that...should i use webservices...if yes can you tell me the exact procedure..?


thanks..
Posted
Comments
koolprasad2003 18-Jun-11 4:57am    
Why do you want to access website2 ? do you want to copy the files ?

There are some options for this kind of requirement.

1. If both sites are related and no need of any kind of privacy, then you can have connection string of both the database in the both web application. With the use of connection string you can retrieve/submit data to both sites.

2. If both are different and you must have to separate configuration then you can create a web service
Many examples[^]

3. You can also create a WCF call. More Details[^]
 
Share this answer
 
Comments
Veerareddy Pallela 18-Jun-11 4:15am    
thank you for you replay

ok..i will use webservice...but will sql database accept two connections at the sametime(from webservice and website1)..?

can you explain me the first point in detail...?
That's Aragon 27-Jun-11 2:59am    
Yes, SQL should accept the two connections(of two different database) at the same time.

1. As per your requirement, you need to access website1 data into website 2. So keep two connection string ConnectionString1(database1,website1) and ConnectionString2 (database2,website2) in the website 2

2. Retrieve necessary data of website1 with use of connectionstring1 in the website 2. As you have valid connection string database will allow to access the data.

3. You have website1 data with you in the website2 now. You can do manipulation on that data and use it as per your application requirement.

Hope it helps.
Start here[^]. A web service solution is probably the easiest way to get the data from one to another.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900