Link to home
Start Free TrialLog in
Avatar of arthurh88
arthurh88

asked on

2 different databases in single Gridview? ASP.NET

I have 2 different databases...one is on MSSQL server, the other is an access database.  I know how to create a gridview for each of those on its own, but how do I do it to display columns from a table in each databases?  I mainly need it to display my data.  If I cant get both results into a single gridview, what other way can I do this?  I need columns from  a table in each database displayed into a single view.
Avatar of tigin44
tigin44
Flag of Türkiye image

create linked server from sql to access and then reference the tables on access as..

SELECT T1.colx, T2.coly
FROM  dbo.SQLServerTable T1
     INNER JOIN [linkedServerName]...accessTable T2 ON T1.id = T2.id

you can find detatiled information about creating linked server from sql to access in here

http://www.aspfree.com/c/a/Microsoft-Access/Configuring-a-Linked-Microsoft-Access-Server-on-SQL-2005-Server/
Avatar of Dustin Hopkins
Hmm, you could setup the access database as a linked server in your sql server, then just run a multi-database query.

here is a more descriptive link.
http://www.aspfree.com/c/a/Microsoft-Access/Configuring-a-Linked-Microsoft-Access-Server-on-SQL-2005-Server/

hope this helps,
Dustin
Avatar of arthurh88
arthurh88

ASKER

the problem is that my SQL server is on a dedicated server remotely, and the Access DB is here on my laptop.  I'm writing a local .NET application that i will use on my laptop to help me manage my business data, but I need to utilize the access DB on my laptop while working off the main SQL server.  I dont think it will work to log onto my dedicated server in the "cloud" to link the access DB on my local laptop :(  Am I hosed?  lol
so you should  use open query
ASKER CERTIFIED SOLUTION
Avatar of amar31282
amar31282
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hola!  i missed that.  great idea