473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

2 Database on hosted in different different servers

I have 2 databases. These are host on different different servers. I want to join the tables of those databases.
here..(1) UserId is same in both database table
(2) Table name are TB1 and TB2
(3) Database are DB1 and DB2

i want to bind the data in a gridview from both database's tables.

Note 1 :-Is this possible to get both tables data from a single connectionstring in C#.

Note 2 :- is this possible that 2 connectionstring call in a single SQLConnection Con = new SQLConnection(.....).

Please help me and send me Query. as soon as possible.

Thanks
Nov 19 '14 #1
3 1363
Frinavale
9,735 Expert Mod 8TB
No it is not possible to use the same connection string to connect to 2 different databases. The connection string is unique to the database that the connection is meant to utilize.

However, it is possible to fill tables within an in-memory DataSet with data from multiple databases.

You can bind your GridView to the DataSet containing the information.

-Frinny
Nov 19 '14 #2
I haven't encountered this setup and from the looks of it I may say it's impossible.
Nov 26 '14 #3
Frinavale
9,735 Expert Mod 8TB
It isn't impossible to bind a GridView to a data source that contains data that is retrieved from multiple databases or other sources.

You would just retrieve the data from data source A and store that information into an in-memory data cache (like a DataSet or DataTable) and then you would retrieve more data from source B and also store that information into the in-memory data cache. It's pretty straightforward.

It is impossible to use the same connection to retrieve the data from multiple data sources though. I mean, you could re-use the objects but the connection parameters and commands would have to be changed to match the source that it is connecting to.

-Frinny
Nov 26 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: erin | last post by:
When I run: select * from testtable I get this error message: Invalid object name 'testtable'. However, if I run: select * from testuser.testtable
6
by: alex via SQLMonster.com | last post by:
Hi, anybody can help me. How can i synchronize 2 tables on 2 different sql servers 2000 i mean TABLE1(col1, col2, col3, col4) and TABLE1(col1, col2, col3, col4, col5, col6) the first 3...
0
by: Scott | last post by:
Has anyone setup DB2 8.1 (fix patch 7) on Windows 2000 to be a DRDA server? I want to have an iSeries with OS400 V5R2 act as a DRDA client to an 8.1 DB2 UDB database hosted on Windows and so it can...
4
by: Burghew | last post by:
Hi all, I am trying to design a database in access 2002. I have multiple category of items such as computers which may include laptop, server, pc...all of these items have different attributes,...
1
by: abhijit | last post by:
Hi Xperts, I have multiple Web Sites in different Live Servers. I want to login any of the sites, and then I will access all the other sites without giving any more login information (i.e I want...
1
by: Pronojit Roy | last post by:
Hi Xperts, I have multiple Web Sites in different Live Servers. I want to login any of the sites, and then I will access all the other sites without giving any more login information (i.e I want...
1
by: peggitt | last post by:
I need help. I need code to connect my java program with a mysql database hosted by an internet service provider(domain). The java program should run locally but read and write to a database on the...
11
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Is there a way in ASP.NET 2.0 to have different connection strings settings in a web.config files that are dynamically used based upon the server that the web application is running on? For...
0
by: basissathish | last post by:
Hi, I would like to add a DB2 database partition in different drive eg: existing DB partition drive H, now we need to add drive J please help me on this, looking for the earliest reply ...
0
by: omakhileshchand | last post by:
Dear All, I have two Astersik Server 'A' and 'B' . In Asterisk Server 'A' have five different ivr (Sevices) is playing and call is forwarding into Server 'B'. Server 'B' basically use for agent...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.