Browse DevX
Sign up for e-mail newsletters from DevX


ADO.NET: Building Your First Data-Aware Form : Page 4

The first article in this series detailed how to build data-aware forms in Visual Studio .NET using the Data Form Wizard. It demonstrated how easy it is to build forms using a point-and-click interface. You also learned that the generated form was not especially suited to production development. This article continues where that article left off and introduces you to techniques to improve data-aware forms created with the Data Form Wizard.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

The Stored Procedures
This solution implements six stored procedures in the Pubs SQL Server database. Those procedures are listed as follows:
  • sp_authors_blank: Returns an empty author record
  • sp_authors_delete: Deletes a specific author record
  • sp_authors_insert: Inserts a new author record
  • sp_authors_list: Obtains a list of authors
  • sp_authors_select: Selects data for a specific author
  • sp_authors_update: Updates data for a specific author
Please refer to the pubs.sql script file in the ZIP file that contains the source code for this article. Before working with the data tier component and data form, you must run the script. You can download this file from http://www.code-magazine.com/downloads/sepoct2002adodotnet.zip.

The first article of this series left off with the following three questions:

  • Which of the generated code is good?
  • Which of the generated code is bad?
  • How can the code be optimized?
When dealing with the first question you can conclude that not much was worth saving. That pretty much answers the second question, in that all the code was bad. Perhaps the underlying principle of the code was fine but the means used to carry out the intended result were not so good. In any case, this article has shown a method for how the code can be re-tooled and optimized. By implementing a component-based approach and by allocating the work to the proper tier, the mass of unintelligible and complex code was simplified. Hopefully for you, this has brought a sense of clarity to your understanding of ADO.NET and how data-aware forms can be implemented in .NET. By no means is this article meant to convey the notion that the solution discussed here is perfect or optimal, it is merely a first cut on how to employ a new technology. Hopefully, this solution gives you some ideas on how to employ component-based/database application development with Visual Basic, Visual Studio and ADO.NET.

John V. Petersen has nearly ten years of software development experience. He is a Microsoft Most Valuable Professional and has spoken at many developer events, including DevDays and TechEd. In addition, John has written numerous magazine articles. John's latest book project is The Absolute Beginner's Guide to Databases published by Que Publishing. John holds an MBA and is currently working on his law degree from the Rutgers University School of Law. jpetersen@mainlinesoftware.com.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date