Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Database connections class
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01108437
Message ID:
01108821
Vues:
11
>Dawa,
>
>I think you would need two classes. One, a DataAccess class that would handle/determine the commands or Stored Procs that you need to call. And your DataConnection class would handle the connection and the creation/management of either OleDb or Sql Commands and DataAdapters.
>
>So, your Business layer may need to get a Customer. It calls the DataAccess layer's GetCustomer() method, passing the CustomerID and getting a DataSet in return.
>
>The GetCustomer() method of the DataAccess class does all the legwork of determining how to get the data (setting the CustomerID parameter if you're using a Stored Proc, setting the command string to either the Stored Proc name or the SELECT FROM....etc.) and passes the appropriate info to a GetData() method of the DataConnection class, getting a DataSet in return.
>
>The GetData() method of the DataConnection class will then use either OleDb or Sql Commands and DataAdapters, depending on whether it's connecting to VFP or SQL ... which it can determine from the connection string which it reads from the config file. It returns the filled DataSet.
>
>If you're using Typed DataSets, then a CustomerDataSet could be instantiated in your GetCustomer() method and be one of the parameters passed to the GetData() method so that it fills and returns the proper Typed DataSet rather than just a generic DataSet.
>
>This is all very off the top of my head, but it should give you some ideas.
>

Bonnie,

When I saw that I had a response, had a feeling that it might be you. Thank you so much for the "very off the top of my head" inof! I'm gonna experiment with what you've suggested.
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform