• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

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.
0
arthurh88
Asked:
arthurh88
1 Solution
 
tigin44Commented:
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

0
 
tigin44Commented:
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/
0
 
Dustin HopkinsCommented:
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
arthurh88Author Commented:
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
0
 
tigin44Commented:
so you should  use open query
0
 
amar31282Commented:
if i m not misunderstanding your requirements

why not to do it using datasets/datatables and use datarelations in them...

fill the dataset with data from both databases and use it to show results ...

0
 
arthurh88Author Commented:
hola!  i missed that.  great idea
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now