Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2003, 07:37 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default database connection

I must create a query to read data on two database (db1 - db2)
on db1 I have the table "customers" with "cod-customer","cust-name " ...
on db2 I have the table "dossier" with "cod-customer" .

I must create a query to read tables dossier and customers where
dossier.cod-customers = customers.cod-customer and read the cust-name

which is code to open database connect with two database on one command?
Help me
Ciao
 
Old October 8th, 2003, 05:19 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Are these databases on the same DB server? What is the DBS platform?
In MS-SQL you can easily work between databases using the syntax
<database>..<tablename>
I don't know about other platforms.

This is usually the easier way to do it, but in ADO with a dataset, you can open several tables, then build relationships between them without (I believe) the need to have those tables residing in the same DB, DB server or even the same format (one from DB, one from XML). As long as there are datatypes that can be tied together in some form of relation.

Peter
 
Old October 9th, 2003, 10:05 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default



Quote:
quote:Originally posted by planoie
 Are these databases on the same DB server? What is the DBS platform?
In MS-SQL you can easily work between databases using the syntax
<database>..<tablename>
I don't know about other platforms.

This is usually the easier way to do it, but in ADO with a dataset, you can open several tables, then build relationships between them without (I believe) the need to have those tables residing in the same DB, DB server or even the same format (one from DB, one from XML). As long as there are datatypes that can be tied together in some form of relation.

Peter
Hello Peter,
DBS platform is Progress, it is 4GL database, and my database is multivolume. To connect odbc.net with two database I using two
DNS files odbc drive. These databases are on the same DB server.
I cannot insert two dns on ODBC.net parameter connection.
Ciao
Peter
Grazie
 
Old October 9th, 2003, 11:30 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I have never worked with that DB, and don't deal with ODBC much. 99.9% of the time I'm on MS-SQL and use the System.Data.SQLClient classes for connection. You'll have to look into the syntax of that DB system to see if you can query across DBs. I'd be surprised if you couldn't. If you can't, then you'll need to look into more advanced ADO.Net functionality.

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection to Access Database reachsevar ASP.NET 2.0 Basics 1 November 28th, 2007 08:56 AM
Database Connection oneillg PHP Databases 1 October 17th, 2007 04:48 PM
Database Connection kapi.goel SQL Language 2 February 14th, 2006 07:01 PM
database connection Nitin_sharma Classic ASP Databases 1 February 8th, 2005 10:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.