Set - 6

Question 1 :

re-clarification of object based?

Answer :

VB6 DOES support polymorphism and interface inheritance. It also supports the "Implements" keyword. What is not supported in vb6 is implementation inheritance.
Also, from above, vb6 DOES "provides access to third-party controls like COM, DCOM " That is not anything new in .NET.


Question 2 :

How to achieve Polymorphism in VB.Net?

Answer :

We can achieve polymarphism in .Net i.e Compile time polymarphism and Runtime polymarphism. Compiletime Polymarphism achieved by method overloading. Runtime polymarphism achieved by Early Binding or Late Binding. Provide the function pointer to the object at compile time called as Early Binding.
provide the function pointer to the object at runtime called as Late Binding
class emp having the method display()
class dept having the method display()

create objects as in the main function
// Early binding
dim obj as new emp
dim ob as new dept

obj.display()-to call the display method of emp class
ob.display-to call the display method of the dept class
// Late binding

create object in the main class as
object obj
obj=new emp
obj.display()-to call the display of emp class
obj=new dept
obj.display()-to call the display of dept class


Question 3 :

Difference between Class And Interface

Answer :

Class is logical representation of object. It is collection of data and related sub procedures with defination.
Interface is also a class containg methods which is not having any definations.
Class does not support multiple inheritance. But interface can support.


Question 4 :

What doesu mean by .NET framework?

Answer :

The .NET Framework is an environment for building, deploying, and running Web Services and other applications. It consists of three main parts: the Common Language Runtime, the Framework classes, and ASP.NET


Question 5 :

What is assembly?

Answer :

It is a single deployable unit that contains all the information abt the implimentation of classes , stuctures and interfaces


Question 6 :

What is namespaces?

Answer :

It is a logical group of related classes and interfaces and that can be used byany language targeting the .net framework.


Question 7 :

.NET framework overview

Answer :

1. Has own class libraries. System is the main namespace and all other namespaces are subsets of this.
2. It has CLR(Common language runtime, Common type system, common language specification)
3. All the types are part of CTS and Object is the base class for all the types.
4. If a language said to be .net complaint, it should be compatible with CTS and CLS.
5. All the code compiled into an intermediate language by the .Net language compiler, which is nothing but an assembly.
6. During runtime, JIT of CLR picks the IL code and converts into PE machine code and from there it processes the request.
7. CTS, CLS, CLR
8. Garbage Collection
9. Dispose, finalize, suppress finalize, Idispose interface
10. Assemblies, Namespace: Assembly is a collection of class/namespaces. An assembly contains Manifest, Metadata, Resource files, IL code
11. Com interoperability, adding references, web references
12. Database connectivity and providers

Application Domain
1. Class modifiers: public, private, friend, protected, protected friend, mustinherit, NotInheritable
2. Method modifiers: public, private
3. Overridable
4. Shadows
5. Overloadable
6. Overrides
7. Overloads
8. Set/Get Property
9. IIF
10. Inheritance
11. Polymorphism
12. Delegates
13. Events
14. Reflection
15. Boxing
16. UnBoxing

ASP.Net
1. Web Controls: Data grid (templates, sorting, paging, bound columns, unbound columns, data binding), Data list, repeater controls
2. HTML Controls
3. Code behind pages, system.web.ui.page base class
4. Web.config: App settings, identity (impersonate), authentication (windows, forms, anonymous, passport), authorization
5. Databind.eval
6. Trace, Debug
7. Output cache
8. Session management
9. Application, Session
10. Global.asax httpapplication
11. User controls, custom controls, custom rendered controls (postback event, postdatachanged event) usercontrol is the base class
12. Directives

ADO.Net
1. Command object (ExecuteNonquery, ExecuteReader, ExecuteXMLReader, ExecuteScalar)
2. DataAdapter object (Fill)
3. Dataset (collection of tables)
4. CommandBuiler object
5. Transaction Object
6. Isolation levels


Question 8 :

To test a Web Service you must create a windows application or web application to consume this service? It is True/False?

Answer :

FALSE


Question 9 :

How many classes can a single.NET DLL contain?

Answer :

Answer1:
As many

Answer2:
One or more


Question 10 :

What are good ADO.NET object(s) to replace the ADO Recordset object?

Answer :

The differences includes
In ADO, the in-memory representation of data is the Recordset.
In ADO.net, it is the dataset

A recordset looks like a single table in ADO
In contrast, a dataset is a collection of one or more tables in ADO.net

ADO is designed primarily for connected access
ADO.net the disconnected access to the database is used

In ADO you communicate with the database by making calls to an OLE DB provider.
In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source.

In ADO you cant update the database from the recordset. ADO.NET the data adapter allows you to control how the changes to the dataset are transmitted to the database.


Question 11 :

On order to get assembly info which namespace we should import?

Answer :

System.Reflection Namespace


Question 12 :

How do you declare a static variable and what is its lifetime? Give an example.

Answer :

Answer1
static int Myint–The life time is during the entire application.
br> Answer2
The static modifier is used to declare a static member, which belongs to the type itself rather than to a specific object. The static modifier can be used with fields, methods, properties, operators, events and constructors, but cannot be used with indexers, destructors, or types. In C#, the static keyword indicates a class variable. In VB, the equivalent keyword is Shared. Its scoped to the class in which it occurs.

Example
a. Static int var //in c#.net
b. static void Time( ) //in c#.net


Question 13 :

What is the maximum length of a varchar in SQL Server?

Answer :

Answer1
VARCHAR[(n)]
Null-terminated Unicode character string of length n,
with a maximum of 255 characters. If n is not supplied, then 1 is assumed.

Answer2
8000

Answer3
The business logic is the aspx.cs or the aspx.vb where the code is being written. The presentation logic is done with .aspx extention.


Question 14 :

How do you define an integer in SQL Server?

Answer :

We define integer in Sql server as
var_name int


Question 15 :

How do you separate business logic while creating an ASP.NET application?

Answer :

There are two level of asp.net debugging
1. Page level debugging
For this we have to edit the page level debugging enable the trace to true in the line in the html format of the page.

%@ Page Language="vb" trace="true"AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1?>

2. You can enable the debugging in the application level for this
Edit the following trace value in web.config file

Enable trace enabled=true.


Question 16 :

If there is a calendar control to be included in each page of your application, and and we do not intend to use the Microsoft-provided calendar control, how do you develop it? Do you copy and paste the code into each and every page of your application?

Answer :

Create the Calendar User Control
The control we will create will contain a calendar control and a label which has the corresponding date and time written
Steps are:-

Creating a CalenderControl
1) To begin, open Visual Studio .NET and begin a new C# Windows Control Library.
2) You may name it whatever you like, for this sample the project name will be CalenderControl

Using the Calender Control in a Windows Application
It's just like adding any other control like a button or a label.
1) First, create a new Windows Application project named: CustomControl.
2) Add a reference to the Calender Control DLL named: CalenderControl.dll.
3) Now you a can customize the Toolbox:
Right-Click the Toolbox> .NET Framework Components> Browse> select the CalenderControl.dll.
4)The Calender Control is now added to the Toolbox and can be inserted in Windows Form as any other control. The control itself will take care of the date display


Question 17 :

How can you deploy an asp.net application ?

Answer :

You can deploy an ASP.NET Web application using any one of the following three deployment options.
a) Deployment using VS.NET installer
b) Using the Copy Project option in VS .NET
c) XCOPY Deployment


Question 18 :

Explain similarities and differences between Java and .NET?

Answer :

Comparing Java and .NET is comparing apples and oranges. Either the question needs to be to compare Java and C# or J2EE and .NET.


Question 19 :

What are the XML files that are important in developing an ASP.NET application?

Answer :

The XML file necessary for the for developing an asp.net application is Web.config


Question 20 :

Specify the best ways to store variables so that we can access them in various pages of ASP.NET application?

Answer :

Declare the variables in Global.aspx


Question 21 :

How many objects are there in ASP?

Answer :

Answer1
8 objects, they are request,response, server,application,session,file, dictionary, textstream.

Answer2
There are 6 objects in ASP.net
a) Server
b) Session
c) Application
d) ObjectContext
e) Response
f) Request


Question 22 :

Which DLL file is needed to be registered for ASP?

Answer :

The dll needed for the ASP.net is SYSTEM.WEB.dll

Is there any inbuilt paging (for example shoping cart, which will show next 10 records without refreshing) in ASP? How will you do pating?

Use DataGrid control which has in-built paging features for the purpose.


Question 23 :

What does Server.MapPath do?

Answer :

Answer1
srver.mappath() maps the path given in the argument to the server's physical path.

Answer2
It returns the complete(absolute) path of the file used in parameter.

Answer3
It returns a string containing the physical path in the server's file system that corresponds to the virtual or relative path specified by the Path argument.


Question 24 :

Name atleast three methods of response object other than Redirect.

Answer :

Answer1
a) Response.Clear( )
Clears the content of the current output stream.
b) Response.Close( )
Closes the network socket for the current response.
c) Response.End( )
Stops processing the current request and sends all buffered content to the client immediately.

Answer2
methods of Response is Redirect a. Transfer


Question 25 :

Name atleast two methods of response object other than Transfer.

Answer :

a) Response.ClearContent( )
Clears the content of the current output stream.
b) Response.ClearHeaders( )
Clears the HTTP headers from the current output stream.


Question 26 :

What is State?

Answer :

It is the property of the web forms.
ASP.NET provides four types of state:
Application state
Session state
Cookie state
View state.


Question 27 :

Explain differences between ADO and DAO.

Answer :

dao- can access only access database
ado- can access any databases


Question 28 :

How many types of cookies are there?

Answer :

2 types, persistant and impersistant.
Answer1
Two type of cookeies.
a) single valued eg request.cookies("UserName").value="Mahesh"
b)Multivalued cookies. These are used in the way collections are used.
e.g.
request.cookies("CookiName")("UserName")="Mahesh"
request.cookies("CookiName")("UserID")="ABC003?

rember no value method in multivalued cookie

Answer2
There are two types of cookies:
Session cookies
Persistent cookies


Question 29 :

Tell few steps for optimizing (for speed and resource) ASP page/application.

Answer :

Avoid mixing html code with asp code


Question 30 :

Which command using Query Analyzer will give you the version of SQL Server and Operating System?

Answer :

@@VERSION
Returns version, processor architecture, build date, and operating system for the current installation of SQL Server.


Question 31 :

How to find the SQL server version from Query Analyzer ?

Answer :

Answer1
To determine which version of Microsoft SQL Server 2005 is running, connect to SQL Server 2005 by using SQL Server Management Studio, and then run the following Transact-SQL statement:
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
The results are:
• The product version (for example, "9.00.1399.06?)
. • The product level (for example, "RTM").
• The edition (for example, "Enterprise Edition").
For example, the result looks similar to:
9.00.1399.06 RTM Enterprise Edition


Question 32 :

How to determine which version of SQL Server 2000 is running

Answer :

To determine which version of SQL Server 2000 is running, connect to SQL Server 2000 by using Query Analyzer, and then run the following code:
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
The results are:
• The product version (for example, 8.00.534).
• The product level (for example, "RTM" or "SP2?).
• The edition (for example, "Standard Edition"). For example, the result looks similar to
:
8.00.534 RTM Standard Edition

Answer2
One can also use SELECT @@Version where the result would look like
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)


Question 33 :

Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table.

Answer :

Answer1.
a. Select count(*) from table1
b. SELECT object_name(id) ,rowcnt FROM sysindexes WHERE indid IN (1,0) AND OBJECTPROPERTY(id, 'IsUserTable') = 1
c. exec sp_table_validation @table = 'authors'

Answer2.
SELECT count( * ) as totalrecords FROM employee
This will display total records under the name totalrecords in the table employee

use COUNT_BIG
Returns the number of items in a group.

@@ROWCOUNT
Returns the number of rows affected by the last statement.
Use this statement after an SQL select * statement, to retrieve the total number of rows in the table


Question 34 :

What is the purpose of using COLLATE in a query?

Answer :

Answer1.
Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.

Answer2.
COLLATE is a clause that can be applied to a database definition or a column definition to define the collation, or to a character string expression to apply a collation cast.


Question 35 :

What is one of the first things you would do to increase performance of a query? For example, a boss tells you that "a query that ran yesterday took 30 seconds, but today it takes 6 minutes"?

Answer :

Answer1.
Use Storedprocedure for any optimized result, because it is an compiled code.

Answer2.
One of the best ways to increase query performance is to use indexes.


Question 36 :

What is an execution plan? When would you use it? How would you view the execution plan?

Answer :

The Query Analyzer has a feature called Show Execution Plan. This option allows you to view the execution plan used by SQL Server's Query Optimizer to actually execute the query. This option is available from the Query menu on the main menu of Query Analyzer, and must be turned on before the query is executed. Once the query is executed, the results of the execution plan are displayed in graphical format in a separate window, available from a tab that appears below the query results window on the screen.


Question 37 :

What is the STUFF function and how does it differ from the REPLACE function? Answer1:

Answer :

stuff-> inserts into it without removing any thing. Replace->replace the given text with the new one.

Answer2:
STUFF - it deletes a specified length of characters and inserts another set of characters at a specified starting point. REPLACE -Replaces all occurrences of a specified string value with another string value.


Question 38 :

What does it mean to have quoted_identifier on? What are the implications of having it off?

Answer :

SET QUOTED_IDENTIFIER ON- Causes SQL Server to follow the SQL-92 rules regarding quotation mark delimiting identifiers and literal strings. Identifiers delimited by double quotation marks can be either Transact-SQL reserved keywords or can contain characters not usually allowed by the Transact-SQL syntax rules for identifiers.


Question 39 :

What is the difference between a Local temporary table and a Global temporary table? How is each one used?

Answer :

Answer1:
Local templrary table will have a single # (#tablename) appended with the table name.Global templrary table will have Double # (##tablename) appended with the table name.
Ex:create table #table1
local temp. table will be available until the session who created it logs out, but global temp. table is available till the last session gets close in SQLServer.

Answer1:
Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions.Prefix local temporary table names with single number sign (#table_name), and prefix global temporary table names with a double number sign (##table_name).


Question 40 :

What are cursors? Name four type of cursors and when each one would be applied?

Answer :

Opening a cursor on a result set allows processing the result set one row at a time.
The four API server cursor types supported by SQL Server are:
a) Static cursors
b) Dynamic cursors
c) Forward-only cursors
d) Keyset-driven cursors


Question 41 :

What is the purpose of UPDATE STATISTICS?

Answer :

UPDATE STATISTICS- it updates information about the distribution of key values for one or more statistics groups (collections) in the specified table or indexed view.


Question 42 :

How do you use DBCC statements to monitor various ASPects of a SQL Server installation?

Answer :

Database Consistency Checker (DBCC) - Is a statement used to check the logical and physical consistency of a database, check memory usage, decrease the size of a database, check performance statistics, and so on. Database consistency checker (DBCC) ensures the physical and logical consistency of a database, but is not corrective. DBCC can help in repairing or checking the installation in case of any failure.


Question 43 :

What is referential integrity and how can we achieve it?

Answer :

Referential integrity preserves the defined relationships between tables when records are entered or deleted. In SQL Server, referential integrity is based on relationships between foreign keys and primary keys or between foreign keys and unique keys. Referential integrity ensures that key values are consistent across tables. Such consistency requires that there be no references to nonexistent values and that if a key value changes, all references to it change consistently throughout the database.
We can achieve this by using foreign key.


Question 44 :

What is indexing?

Answer :

If we give proper indexes on a table so that any queries written against this table can run efficiently. As your data sets grow over time, SQL Server will continue to rebuild indexes and move data around as efficiently as possible. This property is known as Indexing.


Question 45 :

Explain differences between Server.Transfer and server.execute method?

Answer :

Answer1:
server.transfer-> transfers the server's control to the requested page given in the parameter.
server.Execute-> executes the requested page from the current page itself, with no change in the address bar. after execution the next line of code is executed in the current page.

Answer2.
Execute method returns control to the page in which it is called once the page specified in the Execute method finishes processing, the Transfer method does not return control to the calling page.


Question 46 :

What is de-normalization? When do you do it and how?

Answer :

De-normalization is the process of attempting to optimize the performance of a database by adding redundant data. It's used To introduce redundancy into a table in order to incorporate data from a related table. The related table can then be eliminated. De-normalization can improve efficiency and performance by reducing complexity in a data warehouse schema.


Question 47 :

Explain features of SQL Server like Scalability , Availability, Integration with Internet.

Answer :

Scalability - The same Microsoft SQL Server 2000 database engine operates on Microsoft Windows 2000 Professional, Microsoft Windows 2000 Server, Microsoft Windows 2000 Advanced Server, Windows 98, and Windows Millennium Edition. It also runs on all editions of Microsoft Windows NT version 4.0. The database engine is a robust server that can manage terabyte-sized databases accessed by thousands of users. Availability - SQL Server 2000 can maintain the extremely high levels of availability required by large Web sites and enterprise systems. Integration -The SQL Server 2000 TCP/IP Sockets communications support can be integrated with Microsoft Proxy Server to implement secure Internet and intranet communications.


Question 48 :

What is DataWarehousing?

Answer :

A data warehouse is a collection of data gathered and organized so that it can easily by analyzed, extracted, synthesized, and otherwise be used for the purposes of further understanding the data.


Question 49 :

What is OLAP?

Answer :

OLAP is an acronym for On Line Analytical Processing. It is an approach to quickly provide the answer to analytical queries that are dimensional in nature.


Question 50 :

How do we upgrade SQL Server 7.0 to 2000?

Answer :

Run the installation of the SQL Server 2000
In the Existing Installation dialog box, click Upgrade your existing installation, and then click Next.
In the Upgrade dialog box, you are prompted as to whether you want to proceed with the requested upgrade. Click Yes, upgrade my to start the upgrade process, and then click Next. The upgrade runs until finished.
In the Connect to Server dialog box, select an authentication mode, and then click Next.
If you are not sure which mode to use, accept the default: The Windows account information I use to log on to my computer with (Windows). In Start Copying Files dialog box, click Next.
Now your Sql Server would be upgraded.