Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do multiple data sources?
Message
De
19/04/2010 15:31:20
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
How to do multiple data sources?
Divers
Thread ID:
01460976
Message ID:
01460976
Vues:
101
Hi,

I need clarification on the steps necessary for different business objects in a MM.NET application for accessing different datasources.

I'm building an application whose primary data source is a Microsoft SQL Server database. No problem there. I've got some business objects already defined and working that can read and write to the SQL Server database.

But I've got some circumstances where I'm reading some data from other applications (i.e., other data sources). In one example, I need a business object (yet to be defined) that will access data in a totally separate SQL Server database. In another case, I need a business object (to be defined) that will read from an existing VFP database (actually free tables, not contained within a DBC).

I think I'm supposed to add multiple databasekey entries in the app.config file, one for each database I need to access. Is that right?

Then, do I need to manually set the databasekey property to an appropriate databasekey value in the class definition of the business object? I assume this must be the case because if I don't do this, the business object would then refer to the primary database (which I do not want to happen). Am I understanding this right?

I see an entry in the MM.NET help file named "Working with Multiple Data Access Objects" but I can't grasp where to put the suggested sample code, or why it would matter as long as I have already defined the database keys values for each database in the app.config file.

It leads me to think I must be misunderstanding something fundamental.

I'm just looking for the proper steps to follow in a best-practices kind of way.

Any advice?

Guy
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform