Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Access Methods Best Pratice

Status
Not open for further replies.

DerPflug

Programmer
Mar 28, 2002
153
US
Is there some sort of a consensus about the best practices for accessing and saving data through datasets in the .NET development environment? Dealing with the ado control in VB6 has given me somewhat of an aversion to heavy drag and drop coding, dataset creation, etc. Because of this I like to do everything programmatically despite the time that it takes. I usually interact with the database with stored procedures via web services. For instance, when I'm saving data, I create another dataset and insert the values from the text boxes and other controls into it and pass it to the web service which sends it to the stored procedures. Am I being too cautious? Admittedly, I have a pretty small sphere of programming cronies, but what is the best practice for this sort of thing? Binding all controls to the dataset, saving changes to the dataset and writing it back to the database? It would be great to hear from anyone with some experience doing this type of programming for an average to large size company. Any input is appreciated.
 
Well I do lot of client server application design & development but do not have much of web based experience.

Allow me to share what we follow as a common practice in my team with data access model, this might help you.

We have a FormClass, BaseConnectionClass, WorkerClass and DataContainerClass.

FormClass calls to WorkerClass object to populate DataContainerClass and then FormClass reads data from DataContainerClass.

WorkerClass opens connection using BaseConnectionClass, reads data from the table and populate DataContainerClass, and closes the connection.

It re-opens the connection as & when required.

FormClass - Windows Form
DataContainerClass - Business Object
WorkerClass - DataAccess Object
BaseConnectionClass - ODBC/ OLEDB for Oracle/SQL or Access.

I don't know if this helps you.

Have a nice day !
 
Hi vinidel,
I drew a diagram of your process and after looking at the diagram, I must say, I am confused.
In the diagram I numbered the processes and got that there are 6 processes. Here lies my confussion. You seemed to put the connection open process near the end after reading the data. Can you help?
Thanks. . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top