Both SAX and DOM are used to parse the XML document. Both has advantages and disadvantages and can be used in our programming depending on the situation
SAX:
1. Parses node by node
2. Doesnt store the XML in memory
3. We cant insert or delete a node
4. Top to bottom traversing
5. import javax.xml.parsers.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
DOM
1. Stores the entire XML [...]
Archive for October, 2008
Diff b/w DOM and SAX
October 31, 2008Ref and Out keywords in C#
October 30, 2008The out and the ref parameters are used to return values in the same variables, that you pass an an argument of a method. These both parameters are very useful when your method needs to return more than one values.
In this article, I will explain how do you use these parameters in your C# applications.
The out Parameter
The out parameter can be [...]
NAnt
October 28, 2008Introduction
NAnt is a free .NET build tool based on Ant (a build tool for Java). NAnt, like Ant, is similar to Make in that it is used to generate output from your source files. But where Ant is Java-centric, NAnt is .NET-centric. NAnt has built-in support for compiling C#, VB.NET, and J# files and can use Visual [...]
LINQ to SQL
October 28, 2008Getting Started LINQ to SQL:
By using LINQ to SQL, you can use the LINQ technology to access SQL databases just as you would access an in-memory collection.
For example, the nw object in the following code is created to represent the Northwind database, the Customers table is targeted, the rows are filtered for Customers fromLondon, and a string for CompanyName is selected for retrieval.
// Northwnd inherits from System.Data.Linq.DataContext.
Northwnd [...]
ASP.NET Windows Communication Foundation- WebServices
October 28, 2008Difference between ASMX and WCF
[WebMethod]
public string FlyToDestination(Location loc)
{
// Some Code
}
ASMX services are easy to crank and jump start. Think about it. We take an existing Asp.Net website and add a file called “asmx”. Any method we [...]
NHibernate in .NET
October 27, 2008NHibernate is ORM (Object-Relational Mapping) solution and is intended for transparent binding .NET classes to database tables. NHibernate was designed to reduce time efforts to switch application to another database provider. It is achieved by means of replacing SQL with special NHibernate query language (HQL), providing dialects for several databases and providing special classes for [...]
Observer Pattern in C#
October 25, 2008C# – Traditional Method
C# and the other .NET Framework languages do not typically require a full implementation of the Observer pattern using interfaces and concrete objects. Here is an example of using them, however.
using System;
using System.Collections;
namespace Wikipedia.Patterns.Strategy
{
// IObserver –> interface for the observer
[...]
Delegates and Events in C#
October 25, 2008
Delegates and Events in C# / .NET
Content
Overview
Delegates
Call a Function directly – No Delegate
The very basic Delegate
Calling Static Functions
Calling Member Functions
Multicasting
Events
Conventions
Simple Event
The Second Change Event Example
Conclusion
All of us have been exposed to event driven programming of some sort or the other. C# adds on value to the often mentioned world of event driven programming by adding support through events [...]
Common Communication Protocols
October 10, 2008Common protocols
IP (Internet Protocol)
UDP (User Datagram Protocol)
TCP (Transmission Control Protocol)
DHCP (Dynamic Host Configuration Protocol)
HTTP (Hypertext Transfer Protocol)
FTP (File Transfer Protocol)
Telnet (Telnet Remote Protocol)
SSH (Secure Shell Remote Protocol)
POP3 (Post Office Protocol 3)
SMTP (Simple Mail Transfer Protocol)
IMAP (Internet Message Access Protocol)
SQL Server Performance and temporary tables
October 3, 2008Temporary tables where a feature in SQL Server that I tended to avoid. I figured that I should handle everything through code and using subqueries (with IN and EXISTS clauses) or even the new table variables (well… new since SQL Server 2000), but there are excellent efficiencies to be gained by using the tempdb database.
There [...]