Varad, The .NET Guy!

Exploring the excitement of Microsoft .NET and much more..

September 2004 - Posts

.NET Vs IBM WebSphere (J2EE)

The Middleware Company recently published a detailed study comparing .NET 1.1 on Windows Server 2003 to IBM WebSphere 5.1 on RedHat Linux.  The study compares developer productivity, application performance, manageability and reliability of the two platforms.

Two teams were on this motion

  • one to develop the application with WebSphere using J2EE
  • other one to develop the application with Microsoft Visual Studio.NET

Check out the details and result of the complete study here

http://msdn.microsoft.com/vstudio/java/compare/ibmwebsphere/default.aspx

The full Middleware Company report can be downloaded from (you need to register before):

http://www.middlewareresearch.com/endeavors/040921IBMDOTNET/endeavor.jsp

At the end, as always .NET Rocks!

 

Sharing session between ASP and ASP.NET

The following article in MSDN Discusses how to share session state between classic ASP and Microsoft ASP.NET using Microsoft .NET Framework classes and the serialization feature of the .NET Framework. Sharing session state allows converting existing ASP applications to ASP.NET applications in stages while running the applications side by side.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/converttoaspnet.asp

ASP.NET represents a new programming paradigm and architecture, and offers many advantages over classic ASP. Although porting from ASP to ASP.NET is not a simple process, the better programming model and improved performance of ASP.NET will make the conversion process worthwhile. With the exception of storing a COM object in the Session object, the approach described in this article offers a solution that will make the migration process simpler.

Very good article, worth a read!

Posted: Sep 24 2004, 07:33 PM by Varad | with no comments
Filed under:
How to prevent memory leak in C#.NET?

If you are letting .NET to manage memory, it will do a good job of memory management. If you start messing with the Garbage Collector (GC) then you get into big trouble.

.NET's GC does not collect items right away, it lingers around in case the block is needed somewhere else. It collects when it thinks it should.

Don't mess with memory management unless you have a really, really good reason to. The Dispose method is used to release unmanaged resources that aren't handled by the garbage collector, like some streams and graphics operations. If you are using these, then you'll want to call the Dispose method when you're done with the object. The object itself will remain in memory until it's collected, but the unmanaged resources associated with it will be freed.

Note: For most streams, the Dispose method will probably be replaced by the Close method, which does the same thing.

 

Posted: Sep 22 2004, 08:15 PM by Varad | with no comments
Filed under:
Interview with Don Box (the king of COM)

Don Box's interview to .NET Developer Journal during TechEd is now online.

Here are some of his response that I liked very much :)

NETDJ: Do you hold any software certifications - MCP, MCAD, MCSD, etc.? Why or why not?
DB: I have an MS in computer science. Why do I have that? Because I was in grad school for a very long time and they give you a Masters somewhere along the way to a PhD. Beyond that, I just never had a need for certification.

.NETDJ: What do you make of the recent warming of relations between Microsoft, Sun, and Oracle?
DB: We all share the same customers and our customers want our stuff to work together. The whole premise of doing this kind of integration is all about making our stuff work with everyone else's - realizing that we can't get NT running on every box. People are nice enough to invite us into their datacenters, and interop is just good manners. Our customers are going to have non-Microsoft systems and we want to make sure that we are good guests.

.NETDJ: What are your career goals at this point?
DB: To ship Indigo. After that, I'm confident the future will present itself - it always has in the past.

Check out this Exclusive Interview

Good one!

Posted: Sep 18 2004, 03:56 PM by Varad | with no comments
Filed under:
Secure Class & Security to a Class
How can I write a secure class? How to apply security to a class?
 
You can change the DACL on the registry you want to allow access to.
 
There are lots of aspects to security but at a minimum are listed below:
 
* never trust input data: validate it and/or encode it before using it or echo'ing it back
* be very careful about constructing SQL queries in text using user input.
* Prefer paramterized stored procedures if you can use them.
* Validate arguments to p/invoke calls and minimize the use of "unsafe" code in C#
 
Visit the following white paper for more recommendations and considerations. 
 
http://msdn.microsoft.com/library/defaultasp?url=/library/en-us/dnbda/html/authaspdotnet.asp
 
ASP.NET Page Framework Overview

The ASP.NET page framework is a scalable programming model that you can use on the server to dynamically generate Web pages. The ASP.NET page framework is the successor to Active Server Pages

Learn more about

Page Life Cycle
Page Events
Page Directives
Inline Versus Code-Behind Programming Models

here - http://support.microsoft.com/default.aspx?scid=kb;en-us;305141&Product=aspnet

 

Posted: Sep 15 2004, 09:59 PM by Varad | with no comments
Filed under:
C#: Shallow Copy
In C#, the shallow copy is also referred as memberwise copy.
 
A shallow copy creates a new instance of the same type as the original object, and then copies the nonstatic fields of the original object. If the field is a value type, a bit-by-bit copy of the field is performed. If the field is a reference type, the reference is copied but the referred object is not; therefore, the reference in the original object and the reference in the clone point to the same object. In contrast, a deep copy of an object duplicates everything directly or indirectly referenced by the fields in the object.

For example, if X is an Object with references to the objects A and B, and the object A also has a reference to an object M, a shallow copy of X is an object Y, which also has references to objects A and B. In contrast, a deep copy of X is an object Y with direct references to objects C and D, and an indirect reference to object N, where C is a copy of A, D is a copy of B, and N is a copy of M.

The Type of the clone is the same as the type of the original Object.

Out of Box, there are 3 types of Copy Constructor in C# 1) Reference Copy 2) Memberwise copy or Shallow copy and 3) Deep copy.

To learn more about C# Copy Constructor check out this nice article

http://www.phptr.com/articles/printerfriendly.asp?p=25352

 

Posted: Sep 13 2004, 11:03 PM by Varad | with no comments
Filed under:
Delegates in C#
Delegates are a very powerful addition to the C# programming language. Though similar to the C/C++ function pointers, delegates have several added benefits that improve their usefulness.

Delegates are dynamic structures and are declared at runtime. In C/C++ you needed to know the function ahead of time before you can use the function pointers. In C#, delegates require runtime instantiation. This allows you the opportunity to not only using static methods but methods in class instances as well.
 
Delegates don't just point to a single function. Rather they can be thought of as an ordered set of functions where each function in the set as the same function footprint (same return type and same number and types of parameters).
 
Delegates are used in many places throughout the .NET framework especially in the Event handling model .
 
Visit Delegate Tutorial for more information:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkdelegatestutorial.asp
 
Posted: Sep 12 2004, 09:15 PM by Varad | with no comments
Filed under:
Automatically Printing Crystal Reports in ASP.NET

One of the most common questions regarding Crystal Reports in ASP.NET is how to automatically print a Crystal Report. Because the Internet is a stateless, disconnected medium, automatic printing of a Crystal Report using Web Forms cannot be accomplished as easily as when using Windows Forms. This article examines two options for automatic printing of a Crystal Report using ASP.NET and compares one alternative method where the user must initiate printing.

read more here http://aspalliance.com/articleViewer.aspx?aId=509&pId=-1

 

Posted: Sep 07 2004, 10:29 PM by Varad | with no comments
Filed under:
Integrating VSS with Visual Studio .NET

If you are beginning a .NET team development project, you first need to understand how to establish development processes that work in a team environment. You need to know how to set up and work with the team development features supported by the Microsoft® Visual Studio® .NET integrated development environment (IDE), and you also need to be aware of the development techniques (such as how to set assembly references in the correct way) that must be followed by your development team members to ensure successful team working.

Setting up source safe - you can waste alot of time, or follow articles like these and you should be able to get up and running quickly

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/tdlg_rm.asp

Ruari Chuck explains more clearly on Web Development with VSS + VS .NET 2003, He explains about a way that multi developers could effectively work on the same Web based Solution simultaneously without affecting each other or impacting on the unit and module testing of the solution as a whole

http://dotnet.org.za/ruari/articles/1517.aspx

 

More Posts Next page »