Home > Articles > Programming > Windows Programming

Craig's .NET Tips

  • Print
  • + Share This
Obtain some useful .NET tips from expert Web developer Craig Utley.
Craig Utley is the author of A Programmer's Introduction to Visual Basic.NET (Sams, June 2001, 067232203X).
Like this article? We recommend

Like this article? We recommend

Learn the .NET Framework
This Framework provides the underlying workings for all .NET languages. Functionality comes in a "class library", which is a set of classes and methods. The main class library is held in the "System namespace". For example, if you want to perform file input/output, simply use the System.IO namespace. If you want to create multi-threaded applications, use the System.Threading namespace. So, when people tell you that VB.NET supports true free threading, it does, as long as you're using the System class library.

Upgrade Small Projects First
While VB.NET includes a wizard to help you upgrade VB6 projects, start with small projects first. The wizard cannot handle every case, and if you start with a small project, you will likely have a much lower number of items you need to fix yourself. In fact, you may be able to identify certain coding elements in your code that cause problems for the upgrade wizard, and start fixing them before you run the project through the wizard, making the upgrade more successful.

Expose Functionality with Web Services
Distributing applications is often not a fun activity, but .NET makes that easier. One of the simplest ways to distribute applications is to build a lot of the functionality into Web services, which can be called with just HTTP. You don't have to rely on COM, DCOM, or any other transport mechanism. Instead, use the standards-based HTTP to make XML calls to a Web service, which will respond with an XML stream containing the results. However, the XML is hidden from you, so you can continue to program with Web services just as if they were local components.

Use ADO.NET to Boost Scalability
One of my favorite tricks for huge performance gains was to use disconnected recordsets with ADO. Now, ADO.NET is based on a disconnected model. This means that you can have a far greater number of users, while the number of connections to your database server is reduced to a bare minimum. Moving from one record to another doesn't require a trip back to the database, but instead walks through the records held in memory. ADO.NET takes this further by allowing you to create a database schema in memory, with tables and relationships-which means you could actually cache subsets of your database, or the entire database, in memory, and allow access to the records without a connection to the database server.

  • + Share This
  • 🔖 Save To Your Account