18 March 2014

what is .NET and these basic components?

DOTNET means " Data Object Technique Network Enabled Technology".it is framework which supports more than 44 languages.
.NET is a software development platform developed by Microsoft.It runs on Microsoft windows operating systems.
.NET provides tools and libraries that allow developers to develop applications and services much easily,faster and secure by using convenient way.

Basic components of .NET :

1.CLR-common language runtime :
                                 it is responsible for managing the execution of .NET programs.the compiled code is converted into machine instructions that, in turn, are executed by the computer's CPU. The CLR provides additional services including memory management, type safety and exception handling,garbage collection

2.CTS-common type system :
                                 Every datatype is internally represented by a class or structure.all the classes and structures related to datatypes are collectively known as "CTS".
mainly it sets the standard for all the datatypes that you declared integer type as int.

3.CLS -common language specification :
                                 It defines a set of rules and restrictions that every language must follow which runs under .NET framework.

4.MSIL - Microsoft Intermediate language code :
                                In C# program,after the compilation,the code is converted into msil code.it also known as assemble code or metadata.

5.Assembly : fundamental unit of deployment, version control, reuse, activation scoping, and security permissions.

6.Class Library :
                                The class library provides a comprehensive set of facilities for application development. Primarily written in C#, it can be used by any language(by Common Language Specification ).

7.namespace : logically grouping similar classes into a hierarchical structure. This prevents naming conflicts.

EX:-hello world program

using System;//namespace
{
  class Hello//class name
  {
    public static void main()//main function
   {
     Console.WriteLine("Hello World");// for printing same as printf()
     Console.ReadKey();//to hold output window.same as getch()
   }
 }
}

output:Hello World

17 March 2014

Explaining about Namespace in .NET.?

Now Discuss about what is Namespace and why include it in our program.If you want to make a good programmer in c# then you should know more well about Namespace.
Please read every things about Namespace which is give below:
What is Namespace in C#?.
A Namespace is collection of classes with related type contained in a assembly file.
Ex.
 System.IO Namespace is used for I/O related type Files and Buffering.

There are two basic region for  using Namespace.
1. To make the logical group of classes.
2. To avoid the name conflict of classes(means more than class with same program but different Namespace).

Using keyword in all Namespaces. please include it before every Namespace.
1.System - This Namespace  is used for following attribute in our program.
Mathematical computations.
Random Number generation
Garbage collection
Intrinsic data
Exceptions and attributes
2. System.Data -This Namespace is used when we are using Database connectivity in Ado.NET Application. If any Namespace  use "Data" attribute then it will used for Database connectivity in .NET.
3. System.Data.sqlClient - This also used for database connectivity in Ado.NET When we are use sql query for data connection.
4. System.Collections - This Namespace is used when we are using collections (Generic and Non Generic).
5. System.Collections.Generic - This Namespace is used for Generic collection(Ex. ArryList,stack,Dictionary,queue);
6. System.Drawing - This Namespace is used for Graphical Primitive data type such as size,fonts andprinting services etc.
7. System.Reflection - This Namespace is used Run type discovery and dynamic creation of types.
8. System.Security - This Namespace is used for Security Purpose.Suppose if we are using Cryptography security in .NET Application then we will use this Namespace in our .NET Application.
9. System.Threading - This Application is used when we are making a multi-threading application in .Net .
10. System.web - This Namespace is used when we are making a web Application in .NET.Ex. asp.net,XML web services etc.
11. System.Windows.Forms - When  we are making any GUI based application in .NET then we use this Namespace otherwise compiler gives error message.
12. System.xml - When we are using XML Language in our programs then we will use this Namespace in our programs.
13. System.Configuration - When  we configure some .net controls and use it in our .net application. then we use this Namespace.Ex. Configuration of SqlDataSource or SqlDataAdapter and use it for connection.

4 March 2014

Introduction about Structured Query Language (SQL)?

Structured Query Language (SQL) is a standard computer language for relational database management and data manipulation. SQL is used to query, insert, update and modify data.
Most relational databases support SQL, which is an added benefit for database administrators (DBAs), as they are often required to support databases across several different platforms.
 First developed in the early 1970s at IBM by Raymond Boyce and Donald Chamberlin, SQL was commercially released by Relational Software Inc. (now known as Oracle Corporation) in 1979.
The current standard SQL version is voluntary, vendor-compliant and monitored by the American National Standards Institute (ANSI). Most major vendors also have proprietary versions that are incorporated and built on ANSI SQL.
 e.g., SQL*Plus (Oracle), and Transact-SQL (T-SQL) (Microsoft).

One of the most fundamental DBA rites of passage is learning SQL, which begins with writing the first SELECT statement or SQL script without a graphical user interfaces (GUI). Increasingly, relational databases use GUIs for easier database management, and queries can now be simplified with graphical tools, e.g., drag-and-drop wizards. However, learning SQL is imperative because such tools are never as powerful as SQL.

SQL code is divided into main categories as shown below:

  • Queries are performed using the ubiquitous yet familiar SELECT statement, which is further divided into clauses, including SELECT, FROM, WHERE and ORDER BY.
  • Data Manipulation Language (DML) is used to add, update or delete data and is actually a SELECT statement subset and is comprised of the INSERT, DELETE and UPDATE statements, as well as control statements, e.g., BEGIN TRANSACTION, SAVEPOINT, COMMIT and ROLLBACK.
  • Data Definition Language (DDL) is used for managing tables and index structures. Examples of DDL statements include CREATE, ALTER, TRUNCATE and DROP.
  • Data Control Language (DCL) is used to assign and revoke database rights and permissions. Its main statements are GRANT and REVOKE.

Explaining about ActiveX Data Objects (ADO)?

ActiveX Data Objects (ADO) is a collection of software components providing a programmatic interface to access the data sources from client applications.
                                                     ADO acts as a layer to access any data store in a generic way from the application code. It eliminates the need to possess the knowledge of database implementation and reduces the complexity of dealing with the low level code needed to handle the data.

Released in 1996, activeX data object (ADO) originated from the concept of RDO (remote data object) and DAO (data access object). One of the constituents of MDAC (Microsoft data access components), ADO and other MDAC constituents provides a framework of components used by client applications to access SQL, semi-structured and legacy data stores.

ADO.NET is an advanced data access technology designed to work in the .NET environment and is based on the disconnected model for data access. While ADO uses COM (Component Object Model) technology for providing data access service from unmanaged code, ADO.NET depends on managed providers of the CLR (Common Language Runtime) of the .NET framework.

ADO uses an OLEDB provider for connecting to the data sources and accessing data. OLEDB is a component based programmatic interface provided to interact with different data sources. These data sources can be both relational and non-relational databases such as object databases, web pages, spreadsheets or e-mail messages. Prior to OLEDB and ADO, ODBC (open database connectivity) was the popular model used in applications across platforms.

The object model of ADO contains four collections of 12 objects.
The different collections are fields, properties, parameters and errors.

Each collection consists of the following 12 objects:
Connection - for connecting to data source through OLE DB
Command - for sending an instruction (SQL query or stored procedure) to data provider
Recordset - a group of records representing the data
Immediate - a recordset locked in optimistic or pessimistic way
Batch - for committing or doing a rollback database transaction
Transaction - the database transaction
Record - a set of fields
Stream - for reading and writing a stream of bytes
Parameter - for changing the functionality
Field - a column in the database
Property - the ability of OLEDB provider
Error - the error faced by the OLEDB provider during its execution

Explains about ActiveX Data Object.NET (ADO.NET) ?

Definition -
ActiveX Data Object.NET (ADO.NET) is a software library in the .NET framework consisting of software components providing data access services.
  • ADO.NET is designed to enable developers to write managed code for obtaining disconnected access to data sources, which can be relational or non-relational (such as XML or application data). This feature of ADO.NET helps to create data-sharing, distributed applications.
  • ADO.NET provides connected access to a database connection using the .NET-managed providers and disconnected access using datasets, which are applications using the database connection only during retrieval of data or for data update. Dataset is the component helping to store the persistent data in memory to provide disconnected access for using the database resource efficiently and with better scalability.
  • ADO.NET evolved from ADO, which is also a technology similar to ADO.NET with a few basic structural changes. Although there is a provision to work in disconnected mode using ADO, data is transmitted to the database in ADO.NET more efficiently using data adapters. The in-memory representation of data differs between ADO and ADO.NET.
  •  ADO.NET can hold the data in a single result table, but ADO holds multiple tables along with their relationship details. Unlike ADO, data transmission between applications using ADO.NET does not use COM (component object model) marshalling but uses dataset, which transmits data as an XML stream.

The architecture of ADO.NET is based on two primary elements:
1. DataSet
2 .NET framework data provider.

Dataset provides the following components:
  1. a complete set of data including related tables, constraints and their relationships
  2. functionality-like access to remote data from XML Web service
  3. manipulation of data dynamically
  4. data processing in a connectionless manner
  5. provision for hierarchical XML view of relational data
  6. usage of tools like XSLT and XPath Query to operate on the data

The .NET framework data provider includes the following components for data manipulation:
  1. Connection: This provides connectivity to the data source
  2. Command: This executes the database statements needed to retrieve data, modify data or execute stored procedures.
  3. DataReader: This retrieves data in forward only and read-only form.
  4. DataAdapter: This acts as bridge between dataset and data source to load the dataset and reconcile changes made in dataset back to the source.

ADO.NET entity framework of .NET framework 4.0, the new technology of ADO.NET, abstracts the level of data programming so as to eliminate the impedance mismatch between data models and languages, which application developers would otherwise have to deal with.