Wednesday, October 12, 2016

C Language Math Library Function For BCA , BSc(IT) , PGDCA and Other IT Students




Prepared By : Uday Shah - HOD (IT)
Contact No : 7600044051
--------------------------------------------------------------------------------------------------------------------------
MATH FUNCTION

SQRT

Calculates square root of Given number

Declaration:
double sqrt(double x);
Remarks:
sqrt calculates the positive square root of the input value.

Sin
Declaration:
          double sin(double x);
Remarks:
Sin compute the sine of the input value, Angles are specified in radians.

Cos
Declaration:
          double cos(double x);
Remarks:
Cos compute the cosine of the input value, Angles are specified in radians.

Tan
Declaration:
          double tan(double x);
Remarks:
Tan calculate the tangent of the input value, Angles are specified in radians.



Power
Power function, x to the y (x**y)
Declaration:
double pow(double x, double y);
Remarks:
pow and powl calculate x**y.

modf
modf splits double into integer and fraction parts
Declaration:
double modf(double x, double *ipart);
Remarks:
modf breaks the double x into two parts: the integer and the fraction. It stores the integer in ipart and returns the fraction.

Log
log  =  natural logarithm function
log10 = common logarithm function

 Declaration:
double log(double x);
double log10(double x);      

Remarks:
log calculate the natural logarithm of x.
log10 calculate the base 10 logarithm of x.


FMOD
          Fmod function is used for floating pointing modularizing
 Declaration:
double fmod(double x, double y);
Remarks:
fmod calculate x modulo y. This is defined as the remainder




Ceil
ceil is used for  round up the value

Declaration:
double ceil(double x);

Remarks:
ceil finds the smallest integer not < x.

Floor
floor is used for  round down the value
Declaration:
double floor(double x);
Remarks:
floor finds the largest integer not > x.

Abs
abs (a macro) gets the absolute value of an integer
Declaration:
int abs(int x);       
Remarks:
All of these routines return the absolute value of their argument.

Fabs
fabs and fabsl calculate the absolute value of a floating-point number
Declaration:
          double fabs(double x);
Remarks:
All of these routines return the absolute value of their argument.

Exp
Real exp calculates e to the xth power
Declaration:
          double exp(double x);
 Remarks:
exp calculates the exponential function e of  X where Value of e is 2.718282

Div
div divides two integers
Declaration:
          div_t  div(int numer, int denom);
Remarks:
div divides two integers and returns both the quotient and the remainder as a div_t type.


ACOS , ASIN , ATAN

Arc cosine, arc sine, and arc tangent functions
Declaration:
double acos(double x);
double asin(double x);
double atan(double x);
Remarks:
acos  is compute the arc cosine of that value
asin is compute the arc sine of that value

atan is calculate the arc tangent of the input value
Please Give Your Comment and Share it.....

Tuesday, October 11, 2016

Asp.net One Mark Question for IT Students




Prepared By : Uday Shah - HOD(IT)
Contact No : 7600044051

--------------------------------------------------------------------------------------------------------------------------


1.         Full Form of ASP.
Active Server Page
2.         Full Form of CLS
Common Language Specification
3.         JIT Stand For
Just In Time
4.         IIS is Stand For
Internet Information Service  
5.         Textbox Control have _______ types of Input Fields.
 3
6.         How many view in Web Form
3                     
7)         <%@ Page %> is known as.
Directive
8)         .asax is Extension of
Global Page  
9)         To specify the range of age require
Range Expression
10)       AJAX is Stand for
            Asynchronous JavaScript with XML
11)       How many level of Tracing
2
12)       How many type of configuration level.
            2
13)       Choose the form in which Postback occurs.
            Web Forms
14)       Web.Config File is Used for…….
Configure Web Server
15)       Which of the following object is not an ASP Object
Ad Rotator
16)       The First Event Triggers in an aspx page is.
Page_init()
17)       We can manage states in Asp.net Application using
             Session Object , Application Object , View State
18)       Attribute must be set on a Validator Control for the Validation to work.
Control to Validate
19)       Which is used to validate complex string  pattern like E-Mail address.
Regular Expression
20)       File Extension used for Asp.net File
.aspx
21)       An alternative way of displaying text on web page using .
asp:lebel
22)       Why is Global.aspx is used?
            Declare Global variable
23)       Default Session Data is store in Asp.net
            Session Object
24)       How do you get information from a form that is submitted using the “post” method.
            Request Query String
25)       Which object can help you to maintain data across users.
            Session Object           
26)       Which of the following ASP.net object encapsulate the state of the client.
            Session Object
27)       Which of the following control is used to validate the two field are equal.
            Regular Expression
28)       Which of the following is not the way to maintain state.
            Request Object
29)       You can have only one Global.asax file per Project
            Yes     

30)       which is a special subfolder within the windows folder that store the shared.NET component.
            Root Folder
31)       Which of the following is faster and consume lesser memory.
            SQL Data Reader
32)       Where we can include the user lists for windows Authentication?
            <credential>
33)       Which of the following authentication is the best suited for corporate network.
            a) Windows
34)       By Default Asp.net store Session ID in _____
            Global Variable
35)       Which of the following is last stage of the web forms lifecycle.
            page_unload
36)       ______ is the first method that is fired during the page load.
            page_init()
37)       _____ method are used with application object to ensure only one process accesses a variable at a time
            Sychronize()
38)       ______ is the DataType return in isPostBack Property.
            boolean
39)       The Tick Event is Found only in which object.
            Timer
 40)      Menu Control Default View is.
            Vertical
41)       By Default Asp.net Store Session ID in ___________
            Global Variable
42)       What is the best way to store the connection string.
Config File
43)       In which events are the controls fully loadded.
Page_load
44)       What is the name of the property of Asp.net             page that you can query to determine that Asp.net Page is  requested 
isPostBack
45)       For separating server side code from client side code on a asp.net page? What program module should be used    
Code Behind Model
46)       to perform asynchronous data access what must be added to connection string.
            Asynchronous           
47)       To set border in Image user
ImageMap Control
48)       Tree View Control  have _______ different level.
3
49)       Multiview is always work with
view   
50)       Full form of DAO is
            Data Access Object
51)       Full form of  OLEDB is
            Object Linking and Embedding Database
52)       To user SQL server Database data provider is
            System.Data.SqlClient
53)       How many types of Selection mode is available in Calendar Control.
            4
54)       Root Element of Ad rotator control is
            <Advertisements>
55)       How many HotSpot class is available in ImageMap Control.
            3
56)       To Reload enter page when any event is fire then  which option is activated.
            Autopostback             
57)       Which Template is available in Repeater Control.
            ItemTemplate, Header Template ,Footer Template, Alternate Template           

58)       We want to initialize all object and variable only first time then used.
ispostback
59)       What is the meaning of JIT.
Just in Time
60)       What is The extension of Global File.
.asax
Best Wish , Good luck  and Please Give Comment and Like it

Sunday, October 9, 2016



Name : Uday Shah - HOD (IT)
Contact No : 7600044051

--------------------------------------------------------------------------------------------------------------------- 
  1. A primary key is always-
Unique and not null
  1. A foreign key can refer to a-
Only primary key of another table
  1. The constraint, which can be defined only at column level, is-
Not null
  1. A foreign key can be specified with the table name only when-
Both columns have same name
  1. Which of the following is not a character data type?
CLOB
  1. Entity Integrity rule refers to the-
Primary key
  1. Referential Integrity rule refers to the-
Foreign key
  1. Which of the following is not a constraint
Default
  1. A single check constraint can refer to more than one column at-
Table level only
  1. 'On delete cascade' is used to-
Delete parent records and corresponding child records
  1. A unique index is created for which two constrains from the following-
Primary key
Unique Constraint
  1. Which two of the following is true when you create a constraint?
Once created it can't be alerted
A constraint can be created after the table is created
  1. Which of the following is true about a sequence?
It belongs to a specific  schema
  1. The RENAME command can't be used to change the name of-
A column
  1. The NUMBER data type can't be used for-
       Hexadecimal
  1. Which of the following is not a part of SQL?
Data exhibition Language
  1. Which of the following groups are only DML commands?
Update, insert, delete
  1. The default format to enter a data is-
dd/mon/yy
  1. When you want to match the data values using wildcards, the operators used is –
LIKE
  1. An IN operator is equivalent to-
A combination of multiple  OR operators
  1. The '%' wild card character represents-
One or more characters
  1. To find the occurrence of a sub string in the given string the function used is-
SUBSTR
  1. The CONCAT function is similar to-
'||' operator
  1. A HAVING clause is used to restrict-
Groups
  1. A WHERE clause is used to restrict-
Rows
  1. A NULL value is equivalent to-
      Unknown value
  1. The TRUNCATE command is used to-
Remove all  rows from a table
  1. The ALTER TABLE command is not used to-
Disable a constraint
Enable  a constraint
  1. The time format used for the hour, minute and second is-
hh:mm:ss
  1. Which of   the following is not a valid join operation?
subjoin
  1. To perform a self join you require-
an alias
  1. In most cases a join operation between two tables involves –
primary key of one table and foreign key of another
  1. Which of  the following commands does not display duplicate rows-
Union
  1. Which statement does not end a transaction-
ROLLBACK
  1. Identify the correct command to create a new user-
CREATE USER newuser IDENTIFIED BY newuser00
  1. An Index is automatically created on-
a primary key
  1. An index uses the-
rowid
  1. The main purpose of creating a ROLE is-
To Create a role model of a user
  1. The main purpose of creating a view is for –
data security



NOTE :: Please Give Your Comment and Like on Facebook 


Thursday, October 6, 2016

Oracle : Procedure , Function , Trigger , Cursor , PL/SQL Code and Inbuilt Functions








List of Oracle Procedure

Prepared By : Uday Shah – HOD (IT)
Contact : 7600044051
---------------------------------------------------------------------------------

1. Procedure to Print Name

create or replace procedure P1 as
begin
             dbms_output.put_line('Ruparel Education Pvt. Ltd.-Junagadh');
end p1;

pl/sql Code ::

declare
            a number(3);
begin
            for a in 1..5
            loop
                        P1;
            end loop;
end;


2. Procedure to insert Record in Student Table

create or replace procedure P2(xno stud.xno%type,xname stud.xname%type,xcity stud.xcity%type)as
begin
            insert into stud(no,name,city)values(xno,xname,xcity);
end P2;

pl/sql Code ::

declare
            xno number(3);
            xname varchar2(20);
            xcity varchar2(10);
begin
            p2(&xno,'&xname','&xcity');
end;


3. PL/SQL To Display Record With Exception Handling.
declare
            xno number(3);
            xname varchar2(10);
            xcity varchar2(10);
            no number(3);
begin
            xno:=&no;
            select xno,xname,xcity into xno,xname,xcity from stud where no=xno;
            dbms_output.put_line('Name is ::'||xname);
            dbms_output.put_line('City is ::'||xcity);
            exception        
                        when no_data_found then
            dbms_output.put_line('Record Not Found');
end;

4. Procedure to Calculate Area of Circle.
create or replace procedure area(pi in number,r in number,a out number)is
begin
            a:=pi*power(r,2);
end;

pl/sql Code ::

declare
            pi number:=3.14;
            r number(5);
            a number(8,2);
begin
            r:=&r;
            area(pi,r,a);
            dbms_output.put_line('Answer is::'||a);
end;

5. Procedure to Calculate Simple Intrest
create or replace procedure sim(p in number,r in number,n in number,si out number)is
begin
            si:=p*r*n/100;
end;
pl/sql Code ::

declare
            p number(10);
            r number(10);
            n number(10);
            si number(10);
begin
            p:=&p;
            r:=&r;
            n:=&n;
            sim(p,r,n);
            dbms_output.put_line('Simple Interest is::'||si);
end;


6. Function To Check Roll No and Generate New Roll No
create or replace function chek(st varchar2)return
varchar2 is
            fnm varchar2(10);
            str varchar2(10);
            i number(10);
            roll number(10);
            p number(10);
            c number(10);
            r number(10);
            status number(10);
begin
            p:=1;
            roll:=1;
            str:=st;
            i:=1;
            select count(rollno) into r from stud;
            while i<=r
            loop
                        select firstnm into fnm from stud where rollno=roll;
                        if fnm=str then
                                    p:=0;
                                    /* return status:=1; */
                                    return true;
                        else
                                    p:=1;
                                    roll:=roll+1;
                                    i:=i+1;
                        end if;
            end loop;
            if p=1 then
            /* return status:=0; */
            return false;
end if;
end;



7. PL/SQL to Print Number in Reverse Number using For Loop
declare
           
            given_no varchar2(5);
            len number(2);
            rever_no varchar2(5);
begin
            given_no := '&Enter_no';
            len := length(given_no);
            for cntr in reverse 1.. len
            loop
                        rever_no := rever_no || substr(given_no,cntr,1);
            end loop;
            dbms_output.put_line('The given No is ' || given_no);
            dbms_output.put_line('The Reverse No is ' || rever_no);
end;


8. PL/SQL to Print Number in Reverse Number using While Loop
declare
            no number(8);
            m number(8);
            r number(8);
            tot number(8);
begin
            no := &Input_no;
            tot := 0;
            while no >  0
            loop
                        r := mod(no,10);
                        tot := tot *10 + r;
                        no := floor(no /10);
            end loop;
            dbms_output.put_line('Total is ' || tot);
end;




9. PL/SQL to Update Employee Salary with Rs. 10 in inputted Department No.
declare
            no number(3);
begin
            update emp set sal=sal+10 where deptno=&deptno;
            if no:=sql%rowcount > 0 then
                        dbms_output.put_line('number of  row is' || no);
            else
                        dbms_output.put_line(' no row count');
            end if;
end;

10. Example Of Save point and  Commit

declare
            t_sal number(10);
begin
            savepoint s;
            update emp set sal=sal+2000 where ename='&name';
           
            select sum(sal) into t_sal from emp;
           
            if t_sal<10000 then
                        Rollback to savepoint s;
            dbms_output.put_line('Total salary of all Employee is less then 20000');
            end if;
            Commit;
end;

11. Code To Create Snapshot
create snapshot nw_emp pctfree 10 pctused 70 tablespace system
storage (initial 50k next 50k pctincrease 0)
refresh start with (sysdate+0)+2/24
as select empno,ename,deptno from emp

12. Function to Return Square of Given Number
create or replace function sqr(n in number) return number is
square number(10);
begin
square:=n*n;
end;




13. Function To Return Sum of Digit of Inputted Number
create or replace function sod(n in number)
return number is
r number(2);
sm number(3);
no number;
begin
            sm:=0;
            no:=n;
            while no=0
            loop
                        r:=mod(no,10);
                        sm:=sm+R;
                        no:=floor(no/10);
            end loop;
                        return sm;
end;


14. PL/SQL to Display and Update Employee Information
declare
            e2 emp%rowtype;
            eno emp.empno%type;
            salary emp.sal%type;
            enm emp.ename%type;
begin
            eno:=&eno;
            select * into e2 from emp where empno=eno;
            select sal into salary from emp where empno=eno;
            dbms_output.put_line('Employee no is '||e2.eno);
            dbms_output.put_line('Employee salary is '||e2.salary);
            dbms_output.put_line('Employee name is '||e2.enm);
           
            if salary<2000 then
            update emp set sal=sal+2000 where empno=eno;
            else
            update emp set sal=sal-2000 where empno=eno;
            end if;
end;



15. PL/SQL  to input 3 number and print Total and Percentage of it
declare
m1 number(3);
m2 number(3);
m3 number(3);
total number(5);
per number(5);

begin
            m1:=&m1;
            m2:=&m2;
            m3:=&m3;
           
            total:=m1+m2+m3;
            per:=total/3;
           
            dbms_output.put_line('Total of three subjects are='||total);
            dbms_output.put_line('Persantage of three subjects are='||per);
end;


16. Function to Calculate Multiplication
create or replace function multi(n1 number, n2 number)
return number is
m number;
begin
            m:=n1*n2;
            return m;
end;


pl/sql Code ::

declare
            a number;
            b number;
            m number;
begin
            a:=&a;
            b:=&b;
            m:=multi(a,b);
            dbms_output.put_line('multiplication is' ||m);
end;




17. Function To Calculate Maximum Value
create or replace function max1(n1 number, n2 number)
return number is

m number;
begin
            if n2>n1 then
            m:=n2;
            else
            m:=n1;
            end if;
            return m;
end;


pl/sql Code ::

declare
            a number;
            b number;
            ans number;
begin
            a:=&a;
            b:=&b;
            ans:=max1(a,b);
            dbms_output.put_line('maximum is '||ans);
end;

18. Example of While Loop
declare
            i number(3);
begin
            i:=1
            while i<=10
            loop
            dbms_output.put_line(i);
            i:=i+1;
            end loop;
end;




19. PL/SQL Code to check input name and if exist then Update it.

declare
            no  emp.empno%type;
            ans boolean;
            dt date;
            nm emp.ename%type;
begin
            nm:='&name';
            select empno into no from emp where ename=nm;
            if nm=nm then
                        ans:=true;
            else
                        ans:=false;
            end if;
            if ans=true then
                        goto status;
            else
                        dbms_output.put_line('empno:'||no||' inActive'||nm);
            end if;
            <<status>>
             update emp set sal=sal+100 where empno=no;
             select hiredate into dt from emp where empno=no;
             insert into inact_mstr(acnt_no,opndt) values(no,dt);
             dbms_output.put_line('empno: '||no||' is marked as Active');
            exception
            when no_data_found then
             dbms_output.put_line('Invalid Employee name......'||nm);
end;


20. Cursor to Insert Update and Audit Employee  Records

declare
            cursor c_sal is select empno,ename,sal from emp where deptno=20;
            xno emp.empno%type;
            xnm emp.ename %type;
            xsal emp.sal%type;
            no number;
begin  
            open c_sal;
            if c_sal %isopen then
            loop
                        fetch c_sal into xno,xnm,xsal;
                        no:=c_sal %rowcount;
                        exit when no=10;
                        insert into new_emp values(xno,xnm,xsal,sysdate);
                        update emp set sal=xsal+(xsal*0.10) where no=xno;
            end loop;
                        close c_sal;
            else
                        dbms_output.put_line('unable to open cursor');
            end if;
end;                            



21. Cursor To Display Employee Records

declare
            cursor c_emp is select e.ename,e.deptno,e.sal from emp e,dept d;
            enm emp.ename%type;
            dno emp.deptno%type;
            salary emp.sal%type;
            no number(3);
begin
            open c_emp;
            dbms_output.put_line('Name Department Salary');
            dbms_output.put_line('---------- ---------- ----------');
            loop
                        fetch c_emp into enm,dno,salary;
                        no:=c_emp %rowcount;
                        dbms_output.put_line(enm||'     '||dno||'::   ::'||salary);
                        exit when no=5;
            end loop;
            dbms_output.put_line('Number of Row Is ::'||no);
end;


22. Cursor To display Employee Name , Salary and Job

declare
            cursor cur1_loop is select ename,sal,job from emp where deptno=&no;
            xnm emp.ename%type;
            xsal emp.sal%type;
            xjob emp.job%type;
begin
            open cur1_loop;
            loop
                        fetch cur1_loop into xnm,xsal,xjob;
                        exit when cur1_loop %notfound;
                        dbms_output.put_line(xnm||' Having Salary '||xsal||' Whuch job is '||xjob);
                        end loop;
            close cur1_loop;
end;



23. Cursor to Display Employee Information with %ISOPEN Attribute
declare
            cursor cur_loop is select empno,ename,sal from emp where deptno=&no;
            xno emp.empno%type;
            xnm emp.ename%type;
            xsal emp.sal%type;
begin  
            open cur_loop;
            if cur_loop %isopen then
            loop
                        fetch cur_loop into xno,xnm,xsal;
                        exit when cur_loop%notfound;
                        insert into new_emp values(xno,xnm,xsal,sysdate);
            end loop;
            close cur_loop;
            else
                        dbms_output.put_line('Update to Open Cursor');
            end if;
end;


Wednesday, October 5, 2016

Asp.net Short Question and Viva Question



Prepared By : Uday Shah - HOD(IT)

Call : 7600044051

E-Mail : rupareleducation@gmail.com
-----------------------------------------------------------------------------------------

Describe state management in ASP.NET.

State management is a technique to manage a state of an object on different request.

The HTTP protocol is the fundamental protocol of the World Wide Web. HTTP is a stateless protocol means every request is from new user with respect to web server. HTTP protocol does not provide you with any method of determining whether any two requests are made by the same person.

Maintaining state is important in any web application. There are two types of state management system in ASP.NET.

-Client-side state management
- Server-side state management

---------------------------------------

Explain client side state management system.

ASP.NET provides several techniques for storing state information on the client. These include the following:

view state: ASP.NET uses view state to track values in controls between page requests. It works within the page only. You cannot use view state value in next page.

control state: You can persist information about a control that is not part of the view state. If view state is disabled for a control or the page, the control state will still work.

hidden fields: It stores data without displaying that control and data to the user’s browser. This data is presented back to the server and is available when the form is processed. Hidden fields data is available within the page only (page-scoped data).

Cookies: Cookies are small piece of information that server creates on the browser. Cookies store a value in the user’s browser that the browser sends with every page request to the web server.
Query strings: In query strings, values are stored at the end of the URL. These values are visible to the user through his or her browser’s address bar. Query strings are not secure. You should not send secret information through the query string.

---------------------------------------

Explain server side state management system.

The following objects are used to store the information on the server:

Application State:
This object stores the data that is accessible to all pages in a given Web application. The Application object contains global variables for your ASP.NET application.

Cache Object: 
Caching is the process of storing data that is used frequently by the user. Caching increases your application’s performance, scalability, and availability. You can catch the data on the server or client.

Session State: 
Session object stores user-specific data between individual requests. This object is same as application object but it stores the data about particular user.

---------------------------------------

Explain cookies

A cookie is a small amount of data that server creates on the client. When a web server creates a cookie, an additional HTTP header is sent to the browser when a page is served to the browser. The HTTP header looks like this:

---------------------------------------



Describe the disadvantage of cookies.

- Cookie can store only string value.
- Cookies are browser dependent.
- Cookies are not secure.
- Cookies can store small amount of data.

---------------------------------------

What is Session object? Describe in detail.

HTTP is a stateless protocol; it can't hold the user information on web page. If user inserts some information, and move to the next page, that data will be lost and user would not able to retrieve the information. For accessing that information we have to store information. Session provides that facility to store information on server memory. It can support any type of object to store. For every user Session data store separately means session is user specific.




---------------------------------------

 



What are the Advantages and Disadvantages of Session?

Following are the basic advantages and disadvantages of using session.

Advantages:

- It stores user states and data to all over the application.

- Easy mechanism to implement and we can store any kind of object.

- Stores every user data separately.

- Session is secure and transparent from user because session object is stored on the server.

Disadvantages:

- Performance overhead in case of large number of user, because of session data stored in server memory.

- Overhead involved in serializing and De-Serializing session Data. Because In case of StateServer and SQLServer session mode we need to serialize the object before store.
---------------------------------------

 

Differentiate between client-side and server-side validations in Web pages.

- Client-side validations happend at the client's side with the help of JavaScript and VBScript. This happens before the Web page is sent to the server. 

- Server-side validations occurs place at the server side.
---------------------------------------


Differentiate between authentication and authorization.

-          Authentication is the process of verifying the identity of a user using some credentials like username and password while authorization determines the parts of the system to which a particular identity has access. 

- Authentication is required before authorization. 
---------------------------------------

What are Web server controls in ASP.NET?

- These are the objects on ASP.NET pages that run when the Web page is requested. 
- Some of these Web server controls, like button and text box, are similar to the HTML controls. 
- Some controls exhibit complex behavior like the controls used to connect to data sources and display data.

---------------------------------------

Differentiate between a HyperLink control and a LinkButton control.

- A HyperLink control does not have the Click and Command events while the LinkButton control has them, which can be handled in the code-behind file of the Web page.

---------------------------------------

What are the various types of Cookies in ASP.NET?

There exist two types of cookies in ASP.NET

1. Session Cookie 
It resides on the machine of the client for a single session and works until the user logs out of the session. 

2. Persistent Cookie 
It resides on the machine of a user for a specified period. This period can be set up manually by the user.

---------------------------------------

What is Global.asax file used for?

It executes application-level events and sets application-level variables.

---------------------------------------

Explain ASP.NET Web Forms.

- Web Forms are an extremely important part of ASP.NET. 
- They are the User Interface (UI) elements which provide the desired look and feel to your web applications. 
- Web Forms provide properties, methods, and events for the controls that are placed onto them.

---------------------------------------

What is event bubbling?

- When child control send events to parent it is termed as event bubbling. 
- Server controls like Data grid, Data List, and Repeater can have other child controls inside them.

---------------------------------------



What are the various types of validation controls provided by ASP.NET?

ASP.NET provides 6 types of validation controls as listed below:

1. RequiredFieldValidator - It is used when you do not want the container to be empty. It checks if the control has any value or not. 

2. RangeValidator - It checks if the value in validated control is within the specified range or not. 

3. CompareValidator - Checks if the value in controls matches some specific values or not. 

4. RegularExpressionValidator - Checks if the value matches a specific regular expression or not.

5. CustomValidator - Used to define User Defined validation.

6. Validation Summary - Displays summary of all current validation errors on an ASP.NET page.

---------------------------------------

Differentiate between namespace and assembly.

- Namespace is a naming convenience for logical design-time while an assembly establishes the name scope for types at run time.

---------------------------------------

Differentiate between early binding and late binding.

Early binding means calling a non-virtual method that is decided at a compile time while Late binding refers to calling a virtual method that is decided at a runtime.
---------------------------------------

Differentiate between Structure and Class.

- Structures are value type while Classes are reference type.
- Structures can not have constructor or destructors while Classes can have them. 
- Structures do not support Inheritance while Classes do support Inheritance.

---------------------------------------

Explain ViewState.

- It is a .Net mechanism to store the posted data among post backs.
- It allows the state of objects to be stored in a hidden field on the page, saved on client side and transported back to server whenever required.

---------------------------------------

What are the various types of Authentication?

There are 3 types of Authentication namely Windows, Forms and Passport Authentication.

Windows authentication - It uses the security features integrated in Windows NT and Windows XP OS to authenticate and authorize Web application users.

Forms authentication - It allows you to create your own list of users and validate their identity when they visit the Web site.

Passport authentication - It uses the Microsoft centralized authentication provider to identify users. Passport allows users to use a single identity across multiple Web applications. Passport SDK needs to be installed to use Passport authentication in your Web application.


Explain Server-side scripting and Client-side scripting.

- Server side scripting - All the script are executed by the server and interpreted as needed. 
- Client side scripting means that the script will be executed immediately in the browser such as form field validation, email validation, etc. It is usually carried out in VBScript or JavaScript.

---------------------------------------

What is garbage collection?

It is a system where a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy.

---------------------------------------

Describe how Passport authentication works.

ASP.NET application with Passport authentication implemented checks the user’s machine for a current passport authentication cookie. If it is not available, ASP.NET directs the user to a Passport sign-on page. The Passport service authenticates the user, stores an authentication cookie on the user’s computer and direct the user to the requested page.

Explain the steps to be followed to use Passport authentication.

1. Install the Passport SDK. 
2. Set the application’s authentication mode to Passport in Web.config. 
3. Set authorization to deny unauthenticated users.
4. Use the PassportAuthentication_OnAuthenticate event to access the user’s Passport profile to identify and authorize the user.
5. Implement a sign-out procedure to remove Passport cookies from the user’s machine.

Explain the advantages of Passport authentication.

- User doesn’t have to remember separate user names and passwords for various Web sites 
- User can maintain his or her profile information in a single location. 
- Passport authentication also avail access to various Microsoft services, such as Passport Express Purchase.

---------------------------------------

What is caching?

- Caching is the technique of storing frequently used items in memory so that they can be accessed more quickly. 
- By caching the response, the request is served from the response already stored in memory. 
- It’s important to choose the items to cache wisely as Caching incurs overhead. 
- A Web form that is frequently used and does not contain data that frequently changes is good for caching. 
- A cached web form freezes form’s server-side content and changes to that content do not appear until the cache is refreshed.

---------------------------------------

Explain the advantages of ASP.NET.

Following are the advantages of ASP.NET.

- Web application exists in compiled form on the server so the execution speed is faster as compared to the interpreted scripts.

- ASP.NET makes development simpler and easier to maintain with an event-driven, server-side programming model.

- Being part of .Framework, it has access to all the features of .Net Framework.

- Content and program logic are separated which reduces the inconveniences of program maintenance.

- ASP.NET makes for easy deployment. There is no need to register components because the configuration information is built-in.

- To develop program logic, a developer can choose to write their code in more than 25 .Net languages including VB.Net, C#, JScript.Net etc.

- Introduction of view state helps in maintaining state of the controls automatically between the postbacks events.

- ASP.NET offers built-in security features through windows authentication or other authentication methods.

- Integrated with ADO.NET.

- Built-in caching features.

---------------------------------------

Explain the different parts that constitute ASP.NET application.

Content, program logic and configuration file constitute an ASP.NET application.

Content files
Content files include static text, images and can include elements from database.

Program logic
Program logic files exist as DLL file on the server that responds to the user actions.

Configuration file
Configuration file offers various settings that determine how the application runs on the server.

---------------------------------------

Explain the components of web form in ASP.NET

Server controls
The server controls are Hypertext Markup Language (HTML) elements that include a runat=server attribute. They provide automatic state management and server-side events and respond to the user events by executing event handler on the server.

HTML controls
These controls also respond to the user events but the events processing happen on the client machine.

Data controls
Data controls allow to connect to the database, execute command and retrieve data from database.

System components
System components provide access to system-level events that occur on the server.

---------------------------------------

Define application state variable and session state variable.

These objects provide two levels of scope:

Application State
Data stored in the application object can be shared by all the sessions of the application. Application object stores data in the key value pair.

Session State
Session State stores session-specific information and the information is visible within the session only. ASP.NET creates unique sessionId for each session of the application. SessionIDs are maintained either by an HTTP cookie or a modified URL, as set in the application’s configuration settings. By default, SessionID values are stored in a cookie.

---------------------------------------

What are the Web Form Events available in ASP.NET?

Page_Init
Page_Load
Page_PreRender
Page_Unload
Page_Disposed
Page_Error
Page_AbortTransaction
Page_CommitTransaction
Page_DataBinding

---------------------------------------

Describe the Server Control Events of ASP.NET.

ASP.NET offers many server controls like button, textbox, DropDownList etc. Each control can respond to the user's actions using events and event handler mechanism.

There are three types of server control events:

Postback events
This events sends the web page to the server for processing. Web page sends data back to the same page on the server.

Cached events
These events are processed when a postback event occurs.

Validation events
These events occur just before a page is posted back to the server.

---------------------------------------


How do you change the session time-out value?

The session time-out value is specified in the web.config file within sessionstate element. You can change the session time-out setting by changing value of timeout attribute of sessionstate element in web.config file.
---------------------------------------

What are the options in ASP.NET to maintain state?

Client-side state management
This maintains information on the client’s machine using Cookies, View State, and Query Strings.
Cookies
A cookie is a small text file on the client machine either in the client’s file system or memory of client browser session. Cookies are not good for sensitive data. Moreover, Cookies can be disabled on the browser. Thus, you can’t rely on cookies for state management.

View State
Each page and each control on the page has View State property. This property allows automatic retention of page and controls state between each trip to server. This means control value is maintained between page postbacks. Viewstate is implemented using _VIEWSTATE, a hidden form field which gets created automatically on each page. You can’t transmit data to other page using view state.

Querystring
Query strings can maintain limited state information. Data can be passed from one page to another with the URL but you can send limited size of data with the URL. Most browsers allow a limit of 255 characters on URL length.

Server-side state management
This kind of mechanism retains state in the server.

Application State
The data stored in the application object can be shared by all the sessions of the application. Application object stores data in the key value pair.

Session State
Session State stores session-specific information and the information is visible within the session only. ASP.NET creates unique sessionId for each session of the application. SessionIDs are maintained either by an HTTP cookie or a modified URL, as set in the application’s configuration settings. By default, SessionID values are stored in a cookie.

Database
Database can be used to store large state information. Database support is used in combination with cookies or session state.
---------------------------------------

Explain the difference between Server control and HTML control.

Server events
Server control events are handled in the server whereas HTML control events are handled in the page.

State management
Server controls can maintain data across requests using view state whereas HTML controls have no such mechanism to store data between requests.

Browser detection
Server controls can detect browser automatically and adapt display of control accordingly whereas HTML controls can’t detect browser automatically.

Properties
Server controls contain properties whereas HTML controls have attributes only.

 

---------------------------------------



What are the validation controls available in ASP.NET?

ASP.NET validation controls are:

RequiredFieldValidator: This validates controls if controls contain data.

CompareValidator: This allows checking if data of one control match with other control.

RangeValidator: This verifies if entered data is between two values.

RegularExpressionValidator: This checks if entered data matches a specific format.

CustomValidator: Validate the data entered using a client-side script or a server-side code.

ValidationSummary: This allows developer to display errors in one place.

---------------------------------------

Define authentication and authorization.

Authorization: The process of granting access privileges to resources or tasks within an application.

Authentication: The process of validating the identity of a user.

---------------------------------------

What is AutoPostback?

AutoPostBack automatically posts the page back to the server when state of the control is changed.

---------------------------------------

Explain login control and form authentication.

Login controls encapsulate all the features offered by Forms authentication. Login controls internally use FormsAuthentication class to implement security by prompting for user credentials validating them.

---------------------------------------

What is the use of Web.config file?

Following are the setting you can incorporate in web.config file.

- Database connections
- Error Page setting
- Session States
- Error Handling
- Security
- Trace setting
- Culture specific setting

---------------------------------------

Explain Managed code an Un-managed code.

Managed code runs under the safe supervision of common language runtime. Managed code carries metadata that is used by common language runtime to offer service like memory management, code access security, and cross-language accessibility.

Unmanaged code doesn't follow CLR conventions and thus, can't take the advantages of .Framework.

 

---------------------------------------



Explain the use of DataAdapter.

- DataAdapter provides the bridge to connect command objects to a dataset object.
- It populates the table in the dataset from the data store and also pushes the changes in the dataset back into the data store.

Methods of DataAdapter:
Fill - Populates the dataset object with data from the data source
FillSchema - Extracts the schema for a table from the data source 
Update - It is use to update the data source with the changes made to the content of the dataset

---------------------------------------

Explain the difference between dataset and datareader.

- Dataset is a disconnected architecture whereas datareader is connected architecture
- Dataset is the best choice when we need to access data from more than one table.
- Dataset is handy when we need to move back while reading records.
- Compare to datareader, using dataset has an adverse affect on speed

---------------------------------------

Explain the various authentication mechanisms in ASP.NET.


ASP.NET supports 3 authentication mechanisms:
1. Windows Authentication: This is used for an intranet based application. Used to authenticate domain users within a network. By default windows authentication is used.
2. Form Authentication: It’s a custom security based on roles and user accounts created specifically for an application.
3. Passport Authentication: This is based on hotmail passport account.