--

...

--

...

--

...

--

...

--

....

Thursday, 30 August 2018

About Array

Often in programming we need to store values of similar data type, to do so we might require multiple variable declarations and that would be tedious to deal with. 
To ease this task, we can take help of Arrays.
  • An Array is a collection of similar type of values or similar Data Types.
  • Data is stored in continuous memory locations.
  • These values can be referred by single variable and the index number (position number).
  • The index number always starts with ZERO.
  • To access the elements of array we use FOR loop.
In C Language we have:
  •     Single Dimentional Array
    • <datatype>  <varName>[<size>];
  •     Multi Dimentional Array
    • <datatype>  <varName>[<size>][<size>]...; 
Limitations:
  • Size or count of values must be known in prior.
  • Arrays are not resizable
  • This leads to memory wastage if requirement is less than the size 
Array based on Data Type
  • Character Array: When we need to store more than one character or string we have use 'char' type array. These arrays have a terminating called 'null' character represented as '\0'. We can create a character array in following ways:
                    A)  Declaration of Array:
                        char Arr1[20];
                        initialization of array:
                        Arr1[0] = 'a';    Arr1[1] = 'b';
                        Arr1[2] = 'c';    Arr1[3] = 'd';
                        Arr1[4] = 'e';    Arr1[5] = 'f';
                        Arr1[6] = '\0';

                    B)  Declaration and Initialization(array initializer):
                        char Arr2[]={'a','b','c','d','e','f','\0'};

                    B)  Declaration and Initialization(string initializer):
                        char Arr3[]="Vilas";

                    D) Declaration and then accepting string from user:
                        char Arr3[20];
                        scanf("%s", arr3);  //don't use '&' before 'arr3'


  • Integer Array : These arrays don't have terminator character. The last element (value) of the array would have index number as SIZE -1. Ways to create 'int' type array:
           A)  Declaration of Array:
                    int arr1[6];
                    initialization of array:
                    arr1[0] = 11;    arr1[1] = 22;
                    arr1[2] = 33;    arr1[3] = 5;
                    arr1[4] = 65;    arr1[5] = 8;

           B)  Declaration and Initialization(Array initializer):
                   int arr2[]={10, 20, 30, 40, 50, 60};

           C) Declaration and then accepting numbers from user:
                   int arr3[5];
                   int i;
                   for(i=0; i<5; i++)
                        scanf("%d", &arr3[i]);


            *** Same is for 'float' and 'double'

Friday, 10 August 2018

Advantages of C Programming


  1. As C Programming is a middle level language, it includes the features of both high level and low level languages.
  2. It can be used for low-level programming, such as scripting for drivers and kernels and it also supports functions of high level programming languages.
  3. C is a structured programming language which allows a complex program to be broken into simpler programs called functions. It also allows free movement of data across these functions.
  4. C language is case-sensitive.
  5. C is highly portable and is used for system programming application which form a major part of Windows, UNIX and Linux operating system.
  6. C is a general purpose programming language and can efficiently work on enterprise applications, games, graphics, and applications requiring calculations.
  7. C language has a rich library which provides a number of built-in functions. It also offers dynamic memory allocation.

Saturday, 4 August 2018

Print the Pyramid using C Programming

Dear friends here you will understand how to print the Pyramid in C Programming. Diagram shown below is designed as per the logic we want to thing before writing the program and then which code we have to use and where we have to place the code.
If any one want more explanation please write a in comment box.

Thursday, 26 July 2018

Creating DataBase in Microsoft SQL Server

Click on Start Button in Windows and Select SQL Server Management Studio.

Give the Server Name (Machine Name
Select Windows Authentication :
User Name, Password is not required, they will be disabled, SQL Server starts directly using User Name, Password supplied while log-in to Windows.
SQL Server Authentication :  
User Name, Password will be enabled, SQL Server asks for User Name and Password, type the user name and password specified while installing the SQL Server Software.
Using user name and password of OS we can login or user name and password available inside SQL Server.
 After doing any one operation click on Connect
Now it will connect to SQL Server and the following screen will appear.

Now to create Database then right click on Database -> Click on New Database ->Type database name ->Click on Ok.




Monday, 16 July 2018

What is C Programming

  1. C is a programming language developed at AT&T’s Bell laboratory of USA in 1972.
  2. It was designed and written by Dennis Ritchie. 
  3. Without any advertisement ‘C’ reputation spreads.
  4. Ritchie seems to be surprised that so many programmers preferred C to older languages like FORTRAN or PL / I.
  5. Possibly why C seems so popular is because it is reliable, easy and simple to use. 
  6. C was meant to be friendly, capable and reliable.

Where C Stands

Problem oriented languages and High Level language.

  • These languages have been designed to give a better programming efficiency i.e. program development.
  • Examples of languages falling in this category are FORTRAN, BASIC, PASCLE etc....

Machine oriented language are low level languages.

  • These languages have been designed to give a better machine efficiency i.e. faster program execution.
  • Example of languages falling in this category are Assembly Languages and machine Language.

C stands in between these two categories. That’s why it is often called a middle level language, since it was designed to have both: A relatively good programming efficiency as compared to machine oriented language and a relatively good machine efficiency as compared to problem oriented languages.

Wednesday, 20 June 2018

Introduction to ASP.NET


To create dynamic web pages. To create web pages on the fly. To create web sites or web applications.
Group of web pages is called web site. Every web page is of two types.
  1. Client side/static page
  2. Server side/dynamic page

Internet : Network of networks is called Internet. Largest network in the world is Internet. The Internet is operated using Web Sites. On Internet we have to place the web site, then only we can access from any where. First of all we have to purchase web space, register it on our name, provide user name and password to it, then create web site and place it on your web space.
To operate Internet we require the following :
  1. Computer
  2. Internet Connection (supplied by ISP)
  3. Telephone line
  4. Browser Software (Internet Explorer/Netscape Navigator/Opera/Neo planet/ Chrome/ Mozilla Firefox)
  5. Modem (Modulator / Demodulator-Dialup/Broadband, Internal/External)

ISP : Internet Service Provider (BSNL/MTNL/VSNL/RELIANCE/AIRTEL/TATAINDICOM/ AIRCEL/ HUTCH/ UNINOR/ IDEA/ VODAFONE)
Internet Connections :
  1. Dial-up
  2. ISDN (Integrated Subscriber Dialup Network)
  3. Broadband
  4. Cable modem
  5. Leased line

Accessing internet :
  1. Start Internet connection
  2. Start Internet Explorer, type the URL (Uniform Resource Locator) of the web site you like to see in address bar then press enter. URL Example :
For Example : 'http://www.rediffmail.com'
In the above example
  • HTTP stands for (Hypertext Transfer Protocol)
  • WWW stands for (World Wide Web)
  • rediffmail.com stands for domain name, .com is domain code.

Benefits of ASP.NET


It represents an exciting new platform for creating web sites with the .net framework, using any .net language. The benefits are,
Structure ASP.NET brings structure back into programming by offering a code-behind page, which separates the client-side script and HTML from the server-side code.
Layout control Using web forms in ASP.NET and positioning controls such as text boxes and buttons is easy, and VS.NET will create the appropriate HTML code for the target browser that is selected. For instance, to be compatible with most browsers, VS.NET will create tables, and nested tables to obtain the desired positioning of the controls. If the application only needs to be compatible with the latest version of Internet Explorer, then VS.NET will position the controls using DHTML.
Compiled Code ASP.NET solves the problem of running interpreted script by compiling the server-side code into IL (Intermediate Language). IL code is significantly faster than interpreted script.
Early binding ASP.NET also uses early binding when making calls to COM components, resulting in faster performance.
Security ASP.NET has an enhanced security infrastructure that can be quickly configured and programmed to authenticate and authorize Web site users.
Performance ASP.NET contains performance enhancements, such as page and data caching.
Diagnostics ASP.NET offers an enhanced tracing and debugging option, which will save time when you are ready to get the system running.
Session State ASP.NET has an improved session object. Session state can be configured to be shared among all servers in a web farm.
.NET Framework Since ASP.NET uses the .NET framework, ASP.NET also inherits the features of the .NET Framework, such as:
  • Automatic memory cleanup via garbage collection
  • Cross language inheritance
  • A large object-oriented base class library
  • The use of ADO.NET to access database
Web Services ASP.NET also provides the web service infrastructure. It is possible to create a web service with very few lines of code.

Friday, 8 June 2018

Creating ConnectionString by using 2-Tier and 3-Tire Architecture


Sunday, 3 June 2018

How to Find ConnectionString

From the Visual Studio Screen go to Server Explorer

From the Server Explorer Right Click on Data Connection and then Select Add Connection
Give the Server Name then Select Database and then Click on Advance Button
After that you will find the Connection String

Saturday, 26 May 2018

Cookies


Cookies

It is small amount of info stored by web server on client machine.

Types of Cookies :

  • Temperary Cookie (the info will be lost when user closes the browser or logout).
  • Permanent Cookie(persistent cookie) : the info will be stored on client machine till the time specified).

For Example

UserName
Password
protected void Button1_Click(object sender, EventArgs e)
{
     ///////////////////////// temporary cookie creation
    HttpCookie cook = new HttpCookie("vilas");
    DateTime dt = DateTime.Now;
    cook.Values.Add("currentdatetime", dt.ToString());
    cook.Values.Add("username", TextBox1.Text);
    cook.Values.Add("password", TextBox2.Text);
    Response.Cookies.Add(cook);
    Label3.Text = "temp cookie created";
}
protected void Button2_Click(object sender, EventArgs e)
{
          ///////////////////////// permanent cookie creation
          HttpCookie cook = new HttpCookie("conco");
          DateTime dt = DateTime.Now;
          cook.Values.Add("currentdatetime", dt.ToString());
          cook.Values.Add("username", TextBox1.Text);
          cook.Values.Add("password", TextBox2.Text);

          ///////////////////////// for permanant
          cook.Expires = dt.AddMinutes(10);
          // DateTime dt1=new DateTime(10,31,2014);
         // cook.Expires = dt1;
          Response.Cookies.Add(cook);
          Label3.Text = "perm cookie created";
}
protected void Button3_Click(object sender, EventArgs e)
{
          ///////////////////////// reading cookie
          HttpCookie cook = Request.Cookies["conco"];
          if (cook != null)
          {
          string dat, user, pass;
          dat = cook.Values["currentdatetime"].ToString();
          user = cook.Values["username"].ToString();
          pass = cook.Values["password"].ToString();
          Label3.Text="date time of creation of cookie is " + d + "--"+"user name is " + u + "--"+"password is " + p + "--";
          }
          else
          {
          Label3.Text = "no cookie present";
          }
}

Friday, 25 May 2018

ADO.NET


ADO.NET (ActiveX Data Objects)

.NET uses ADO.NET (Activex Data Objects) as its primary data access and manipulation protocol.

Database programming can be done thru Controls and Coding.

Database Programming can be done using MS Access, Oracle, MS SQL Server or any ODBC Complaint Database. (Open Database Connectivity).

Steps for database programming :

  • Establish connection with database using respective provider and driver.
  • Open database.
  • Store, Delete, Modify or Read data.
  • Show/Process the data
  • Close database.

Required Namespaces for Providers

ACCESS System.Data.Oledb
Oracle System.Data.OracleClient
SQL Server System.Data.SqlClient
ODBC System.Data.ODBC

Classes of respective Namespaces

ACCESS Oracle SQL Server ODBC
OleDbConnection OracleConnection SqlConnection OdbcConnection
OleDbDataAdapter OracleDataAdapter SqlDataAdapter OdbcDataAdapter
OleDbDataReader OracleDataReader SqlDataReader OdbcDataAdapter
OleDbCommand OracleCommand SqlCommand OdbcCommand
DataSet(System.Data) DataSet DataSet DataSet

Connected Database Programming :

In this type of program client is always connected with server and data is retrieved from it continuously. If you close the connection then we can’t read data. In this type of programming we have to use SqlConnection, SqlCommand, SqlDataReader Classes.

Sequence to use classes in CONNECTED Database Programming

  1. OledbConnection
  2. OledbDataReader
  3. OledbCommand

Using TreeView Control


Treeview

To display Text in tree fashion.

  • Click on Edit Nodes or Nodes (from properties window)
  • Click on Add Root Node
  • Click on Add Child Node
  • Type Node Text in Text property,
    • Select Image File Name for ImageUrl property
    • Select file name for navigation in NavigateUrl property
    • Select True / False from Show Checkbox property
    • Select True / False from Checked property
    • Type _blank in Target property for opening the file in new window
    • Select True/False from Expanded property (for Root item).

Also we can specify SiteMap as Data Source for treeview. For this create a web.sitemap enter all the url’s which you like to use as Hyperlinks,create SiteMapDataSource using web.sitemap then specify SiteMapDataSource as DataSource for the TreeView.

Thursday, 10 May 2018

What we can Develop by using .NET


  1. C#.Net
    • Console Applications
    • Windows Applications
    • Class Libraries
    • User Defined Controls
  2. ASP.Net
    • Web Applications
    • Web Services
    • Web Controls
  3. Windows 8 APPS
    • Mobile Controls
    • Mobile Applications
  4. WCF Service Application (WCF-Windows Communication Foundation)
  5. WPF Application (Windows Presentation Foundation)
  6. WPF Browser Application
  7. Silver light Application
  8. SharePoint
  9. Cloud Computing

Sunday, 6 May 2018

What is IL Code and What is JIT ?

Q.) What is IL Code?
A.) Partially Compiled code or half compiled code.
Q.) Why is It half compiled and not fully compiled?
A.) When we compile our CODE (OS, hardware, config) compiler who converts the source code into the machine language.
When he compiles our code he takes various parameters like OS,hardware, config files.
Let us consider the code which is compiled in windows 7 and as per the situation the     properties is taken like (OS, hardware, config) and optimal code is compiled as per that environment. Now if we try to run the same application on windows 8 then it will run but it will not optimally run means the required performance benefits as compare to windows 7.
So in .NET it compiles the code and converts the code into half compiled format called as IL code. And at Run time one more entity called as JIT compiler. So the JIT comes and takes all the parameters like (OS, hardware, config) and depends on these properties and compiles the optimal code for the same movement.
So at the Run time compiler can figure out what are the parameters and compile the Optimal code as per the environment.

Q.) Who compiles the IL Code to Machine Language and how?
A.) JIT
    How : 1) Per File , 2) Per Method / Function , 3) Code Fragment and all the 3 ways are dependent on JIT which is not controlled from outside.

Q.) What are Types of JIT ?
A.) 3 Types :
    a) Normal JIT : Dynamically requires Method and Stored in Memory (RAM).
    b) Econo JIT : Dynamically and not stored in memory.
    c) Pre-JIT : Full Compilation(Ngen.exe).Native Image Generator.
Q.) How can i force my compilation to Ecnon or Normal JIT?
A.) We cannot.It is internal. If the memory is more then Normal JIT may work and if the memory is low then the Econo JIT will work. CPU power is higher then Normal JIT is Used.

Tuesday, 1 May 2018

Characteristics of C#

  1. Simple : C# simplifies C++ by eliminating irksome operators such as ->, :: and pointers. C# treats integer and Boolean data types as two entirely different types. This means that the use of = in place of == in if statements will be caught by the compiler.
  2. Consistent : C# supports an unified type system which eliminates the problem of varying ranges of integer types. All types are treated as objects and developers can extend the type system simply and easily.
  3. Modern : It is modern language due to a number of features it supports like Automatic garbage collection, Rich intrinsic model for error handling, Decimal data type for financial applications, Modern approach to debugging and Robust security model.
  4. Object-Oriented : C# is truly object-oriented. It supports all the three tenets of object-oriented systems, namely, Encapsulation, Inheritance, Polymorphism. The entire C# class model is built on top of the Virtual Object System (VOS) of the .NET framework. In C# everything is an object. There are no more global functions, variables and constants.
  5. Type-safe : It promotes robust programs. C# incorporates a number of type-safe measures.
    • All dynamically allocated objects and arrays are initialized to zero.
    • Use of any uninitialised variables produces an error message by the compiler.
    • Access to arrays are range-checked and warned if it goes out-of-bounds.
    • C# does not permit unsafe casts.
    • C# enforces overflow checking in arithmetic operations.
    • Reference parameters that are passed are type-safe.
    • C# supports automatic garbage collection.
  6. Versionable : Making new versions of software modules work with the existing applications is known as versioning. C# provides support for versioning with the help of new and override keywords. With this support, a programmer can guarantee that his new class library will maintain binary compatibility with existing client applications.
  7. Compatible : C# enforces the .NET common language specifications and therefore allows inter-operation with other .NET languages.
    • C# provides support for transparent access to standard COM and OLE automation.
    • C# also permits interoperation with C-style APIs.
  8. Flexible : Although C# does not support pointers, we may declare certain classes and methods as ‘unsafe’ and then use pointers to manipulate them. However, these codes will not be type-safe.
  9. Inter-operability: C# provides support for using COM objects, no matter what language was used to author them. C# also supports a special feature that enables a program to call out any native API.

Features of .NET

How does .NET achieve the goal

  1. Web Services (Web services are called as Health storm service through which ones data can be utilized by other people without re-entry of the data of the client). The centre of the .NET architecture.
  2. ADO.Net Datasets & XML support through out the platform (Allows access to disconnected distributed databases. It creates Dataset containing database schemas).
  3. In .NET framework common data types are defined using this data type you can share data between different applications and Microsoft has told to all the software vendors to develop compilers according to these common data types, so that their compilers become .NET Complaint.
  4. Threading is built-in.
  5. Cross language inheritance is one of the best feature of .NET.
  6. Cross language debugging is also possible.
  7. Visual Studio.NET IDE is the GUI editor for all .NET languages.
  8. Under .NET after compilation all languages will generate Intermediate Language Code (IL).
  9. No need of registration, GUIDs.
  10. Multiple versions of the same component can be run side-by-side.
  11. No “DLL Hell”.
  12. Applications will run directly from CD.
  13. Applications install only the core logic.
  14. No need to install runtime libraries.
  15. No need to copy the .dll files with the code.
  16. Object Oriented Paradigm.
    • Classes
    • Objects
    • Data Abstraction
    • Encapsulation
    • Inheritance
    • Polymorphism
    • Interfaces
  17. Common Language Runtime (CLR)
  18. Common Language Specification (CLS) - Common Language Specifications for Cross Language Implementation.
  19. Garbage Collection
  20. Interoperability
  21. Web Applications (ASP.NET)

Introduction to C# .NET

It  is  pure  object  oriented  programming  language.  Also  it  is  Event Driven Programming Language. It is case sensitive. ...