ADO.net Tutorial for beginners

Ado.net:  Ado.net is the new technology and used to connect with different datasource. It provides interoperability and scalable data access by XML. So we can say if any application who can read the XML can process data. It is the new invention of Microsoft to fulfill the today’s application development requirement. Now days web applications are not tightly coupled, they have become loosely coupled web application model. All web applications are xml based.  Ado.net provide disconnected model along with tight integration with XML, Ado.net is based on Microsoft Active X Object (ADO).  It supports n Tier applications with the help of DataSet. Ado.net is based on XML. Means it uses xml for everything for example data encoding and data access.  Here everything is handle at the client side which increate the performance.

It is integral part of .Net Framework.  You can connect with your data source using Ado.net.  ADO.net has two main components as

>> Click here to Read the complete Article

XML Webservice Basic Tutorial

XML stands for extensible markup Language and it was introduced to overcome the HTML limitation. Now days it is very popular because of its unique structure (Text Based), so it can be used in any system, and any OS can read XML without making any changes.  Similar to HTML it is also tag based.

Webservice: Webservice is the solution of distributed applications to share the data. Purpose of Webservice was to pull data back and forth from two heterogeneous systems.  There have been many solutions for building heterogeneous system like CORBA, COM.DCOM, and RMI etc. However all of these have some flaws.  Due to unique architecture of SOAP, Webservice are very popular.

XML Web Services:  When you are working on distributed applications, xml web services are the foundation or building blocks on the net.  Two different (Heterogeneous) applications can work together without knowing the internal details of each others. You will find lots of xml web service definition but all contains the few similar things (source: Microsoft) as:

>> Click here to Read the complete Article

C# 3.0 Object Initializers Tutorial

It was introduced in C# 3.0. Object Initializers allows you to create default values for newly created object along with their type. Now you can easily assign data to specific properties.  In traditional way the following example creates a Book object and passes two values to its constructor.
publicclassBook
{
   int bookno, bookprice;
   public  Book(int _bp, int _pn)
   {
       //code
   }   //setters/getters code will goes here
}

Once you start using this class, you will create the object with default parameters, but you don’t’ have the clear idea about the parameters.  In other words in below line you cannot find which values belongs to which properties. You don’t have the clear idea about parameters and values.
Book objBook = newBook(200, 100);

C# new feature Object Initializers solve this problem and you can save your time a bit, you can easily assign or specify the data to the specific property as

publicclassBook
{
   int bookno, bookprice;

       //setters/getters
   publicint Booknumber { get; set; }
   publicint PageNo { get; set; }

}

Book objBook = newBook(BookPrice = 100, PageNo = 2);

In above line you can directly assign values to both properties “BookPrice” & “PageNo”. From the developer point’s it is really good and more clear now. I can say it gives a clear picture to your class however sometime it creates some confusion when developer leave this choice on user, user might get confused to choose the essentials properties of the system.

String Manipulation Functions in C#


Replace: Replace method is used to change the substring in your string with another string or character set. Replace method is available in all programming language even the syntax is almost same in all.

 

    string str1 = "This string";

           string str2 = str1.Replace("This", "That String");
           Response.Write(str2);

>> Click here to Read the complete Article

Tutorial on Strings in C#

Strings always perform very important role in all languages. They used to manipulate a string.  In .Net strings are the Class objects. They are reference type in .Net and are store in Heap instead of stack. Because they are reference types they So they impact the performance and sometime they become very costly. However .Net has other options too, to handle this situation like ArrayList. We can create dynamic Array using ArrayList which is faster than normal string operations. It’s advisable to use less string as much as possible. .Net strings are immutable means it always creates a new object of string even you modify the existing string object, so again it’s a performance hit.

>> Click here to Read the complete Article

Difference between Events and Delegates in C #

Difference between Events and Delegates in C Sharp

Both are very important in event driven programming, event’s are the reason of happening and delegates are the address of function. Events are like a property and well decorated in IL so that correct method can invoke.

>> Click here to Read the complete Article

Delegates in C#

Delegates:

Definition: Delegates adds more value to event driven programming. They are very similar to function pointer in C++. Delegates are type safe pointers and they provide callback function in safe way. They are used to declare the reference type. Delegates are used to declare custom events. If you want to change the behaviour of your application in runtime, delegates are the best example, in other words here you can apply delegates. They always work with events. Event driven programming contains two types of object:

>> Click here to Read the complete Article

Tutorial – Indexers in C#

Applicable: C# 3.5

Definitions: Indexers was introduced in C# 2.0. Indexers are very similar to array, however, they are very close to the way when used in vb (setters and getters) to access the values. They are used to define the property and provide access to a value of an array outside the class. In array you can access any item or element by using index number which is an integer value. In indexer you can access elements with the name of key rather than value. Like array Indexers can be overloaded. Indexer must have one parameter.

Syntax: <Modifier> type this[type parameter]: where

modifier can be private/public /protected/internal

type: Any Valid type In C#(int, string etc)

this: represent the object of the current class

Parameter: formal – argument list, at least one parameter has to be there, to avoid the compiler error.

Example:

>> Click here to Read the complete Article

Directory Classes Tutorial in C#

Applicable for C#: 1.0, 1.1, 2.0, 3.0, 3.5, 4.0

Directory classes are very important when user want to save information in a file instead of database. Directory works as a folder which contains multiple files like windows folders. In .Net by using System.IO namespace we can do all operation related with directory manipulation such as creating new directory, deleting the content of existing directory, you can rename existing directory or file and many more. Here are the list of few common properties and methods

>> Click here to Read the complete Article

Top VB.Net FAQ, Mostly asked Questions – Part 2

Read Part 1

13. Which window shows the variables in the current line and three lines on either side of the current line while in break mode?

1. Watch Window

2. Autos Window

3. Locals Window

4. Output Window

>> Click here to Read the complete Article