h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

ArrayList in C#.net


             First time, User uses this ArrayList class this error will occur.
Reason: Because user doesn’t declare a namespace for ArrayList.
Solution: Declare Namespace Using System.Collection.
In this Sample Project, I am using enumeration and ArrayList.



In this Example, I am creating an enumeration and Call that enumeration into ArrayList and sort that ArrayList.
Some useful Methods in ArrayList:
  1. Add
  2. AddRange
  3. Remove
  4. RemoveAt
  5. Sort
  6. RemoveRange
Add:
   User can add a information into ArrayList Using Add Method.
This is a Simple Example for Add Method.



AddRange:
     Add the elements of an ICollection to the end of the ArrayList.
ICollection:
· It is an Interface. Because it starts with “I”. Generally, “I” is called Interface.
· Defines size, enumerators, and synchronization methods for all nongeneric collections.



 
Here, I give a sample code for AddRange Method for ArrayList create a two enumeration .One is ComName and another one is ComPort.
Remove:
       User can remove a list of items in ArrayList.
       User can specify a Word.

 
RemoveAt:
       User can remove a list of items in ArrayList.
       User can specify a Index no.



RemoveRange:
       User can remove a list of items in ArrayList.
       User can specify range of remove.



Process Vs Thread in C#.net

Process:
  1.   It Exists in the OS.
  2.   Each and Every Process Contains One or More Threads.
Thread:
  1.   It exists with in Process
  2. It is a Light-Weight-Process.
  3. Threads Share memories with other Thread running in the Same Application.

Basic XML


Introduction:
· XML -- eXtendable Markup Language.
· It is a Case Sensitive.
· It is a Tag Code.
· Easily, it understands by Machine and Human.
· Storing and Retrieving data.
· All elements can have text content and attributes
XML Code likes this
<FirstName></FirstName>
   Structure of XML:


Root Element:
              It is a Parent Element of all Elements.
ATTRIBUTES:
             Additional information about an element.
ELEMENTS:
              It can be extended and carry more information.
              It can have attributes.
TEXT:
              Value of Every Element. User can Read, Write and Modify.
Create XML file in C#.Net:
Declare a namespace for XML
using System.Xml;
using System.IO;





User can create XML file using XMLWriter.




XML File created in the D Driver.


Read XML File Data:

  User can read XML file in two ways.
1)     Using XMLReader
2)     Using SelectSingleNode
1)     Using XMLReader:
              User wants to read all elements in the XML File using XMLReader.
Now, we go to Coding Section.
Using XMLTextReader: