Submit .NET Questions to Computer Education Techniques CETi

Submit .NET Questions to Computer Education Techniques CETi

Submit .NET Questions


Submit .NET Questions

Technology Update

Knowledge Base

Submit .NET Questions to Computer Education Techniques CETi Advanced search

Interrelated Information Technology

MS Application Development Questions MS Operating Systems and Networks Questions
MS .NET Questions XML Questions

The Computer Education Techniques knowledge base is a service for answering questions, inclusive of the research and validation of the accuracy of information in the public domain. Citation of source documentation and examples are used to provide answers to the questions. Utilization of the information of this service and reliance on the answers, information or other materials received through this web site is done at your own risk.

Q Are there generalized .NET performance tips that can be applied to applications?
A Our staff of system consultants support the following guidelines:

1. Throwing exceptions can be very expensive. Perfmon can be used in order to ascertain how many exceptions an application is throwing. The exception number can be examined programmatically by using Performance Counters.

2. A chunky call is a function call that performs several tasks; by comparison chatty calls, do very simple tasks and require multiple calls to get things done. It is important to make chunky, rather than chatty calls across methods where the overhead is higher than for intra-AppDomain method calls. AppDomain is an isolated environment where applications execute.

3. Simple structs should be used when there will be minimal boxing and unboxing.

4. Use AddRange for adding a whole collection, rather than adding each item in the collection iteratively.

Windows controls and collections have both Add and AddRange methods, and each is optimized for a different purpose.

  • Add should be used for adding a single item.
  • AddRange should be used when adding multiple items; however there will be extra overhead.

5. When a string is modified, the run time will create a new string and return it, leaving the original to be garbage collected. This is efficient; however, when a string is being modified repeatedly it will degrade performance.

6. Stored procedures are highly optimized tools that result in excellent performance when used effectively. Set up stored procedures to handle inserts, updates, and deletes with the data adapter. In most situations, CommandType.StoredProcedure should be used instead of CommandType.Text .

Q Can Generics be used in Web Services?
A No. Web services have to expose a WSDL-based contract. Such contracts are limited by the expressiveness of the message format being used.

It is possible to define .NET web services that rely on closed constructed generic types.

Q How can I make use of IsPostPack Method inside UserControl?
A IsPostBack method will always be true inside user control.

The following method will bypass this issue:

  protected override void OnLoad(EventArgs e) {
  if (!IsUserControlPostBack)
  ///Write your code

  //Make ReadOnly property.
  protected bool IsUserControlPostBack{
  return this.ViewState["IsUserControlPostBack"] != null;

Q What is managed code?
A Managed code is code that is written to target the services of the common language runtime. In order to target these services, the code must provide a minimum level of information - metadata to the runtime. All C#, Visual Basic .NET, and JScript .NET code is managed by default.

Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).

Q What is an application domain?
A An application domain / AppDomain is a virtual process that serves to isolate an application. All objects created within the same application scope are created within the same application domain.

Multiple application domains can exist in a single operating system process, making them a lightweight means of application isolation.

Q Is it possible to avoid using the garbage collected heap?
A All languages that target the runtime provide the capability for allocating class objects from the garbage-collected heap. The advantages are fast allocation and avoiding the need for programmers to work out when they should explicitly 'free' each object.

The CLR also provides ValueTypes, which are similar to classes, except that ValueType objects are allocated on the runtime stack and therefore reclaimed automatically when code exits the procedure in which they are defined.

Managed Extensions to C++ provides the capability for selecting where class objects are allocated.

  • If declared as managed Classes, with the __gc keyword, then they are allocated from the garbage-collected heap.
  • If they __gc keyword is not included, they behave like regular C++ objects, allocated from the C++ heap, and freed explicitly with the "free" method.

Q What is an easy way to flag bugs and undone items?
A The Task List tool window in Visual Studio .NET displays a number of useful things including any known compile errors in your code. It can also be set to show bugs and undone items? This will be useful  mechanism for tracking these items.

Whenever typing code and leaving something undone, type in a comment that starts with ‘undone’. Visual Studio .NET will now be able to show all the undone items in the Task List tool window. By default, the Task List is filtered to not show Comment items.

In order to this, right-click on the task list window, and select Show Tasks, and check the Comments box. Selecting all will show all tasks. The Task List now shows the Undone comment, along with the line and column where it exists. Click on the item in the Task List and the code editor automatically goes to that location.

Q How do I use Region in Visual Studio?
A The Visual Studio .NET code editor utilizes the concept of regions. Named regions can be created directly in source code. Regions can then be expanded and collapsed in the editor to hide or show code based on its type. For example, a region called “SysEd Properties” can be created and all the SysEd property code could be placed there. Additional regions can support public methods and privates.

In order to use regions, type the #Region phrase followed by the name for your region and #End Region where the region is terminated.


How can I generate Code Comment Web Pages in Visual Studio?

A C# has the ability to be somewhat self-documenting through the use of XML Comments. You can type XML comments into your code and the Visual Studio .NET Build Code Comment Web Pages command can extract those comments, along with information from the code itself to generate basic documentation web pages.

Q Do your .NET courses teach migration?
A Our Microsoft courses reflect the full range of issues regarding migration: Visual Basic to VB.NET, ASP to ASP.NET. SYS-ED’s .NET training programs can be mixed and matched based upon the existing investment in code and specific operational objectives. And yes, we provide both an examination and integration of .NET with the Java standard.


Will your courses help us to address specific issues relating to multi-vendor / multi-platform issues?


Our Microsoft courses teach the database foundation not only for SQL Server, but all the ODBC options - DB2, Oracle, and Sybase.


Do we have to take all the courses in a curriculum?

A No. We invite you to review the sample programs, course workbooks, and workshops and cross reference them to your project specifications and operational objectives. Our systems consultants will provide consulting expertise and commit in writing the skillset that your staff will acquire in our courses. You only take the courses specific to a project specification. Optionally, we can provide pre and post course validation procedures.


We are not a Fortune 1000 company; and it is important that we leverage our existing investment in web server and Internet technologies.

A Since we are vendor-independent; we can provide unbiased information and hands-on demonstrations as part of your assessing whether or not you should take a course. And we offer the just-in-time training you require to make your operational requirements a reality within a realistic budget.


What if I have specific performance optimization and troubleshooting questions which need to be addressed?

A Our Microsoft programming language courses and training programs reflect not only the how-to’s but the why’s associated with update paths - ASP to ASP.NET, Visual Basic to VB.NET, and Visual C++ to C#. We ave the benchmarks, tools, and utilities to train you to resolve your bottlenecks.