473,320 Members | 1,993 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,320 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 1361
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.