Friday, August 22, 2008

CapGemini Interview Question

CapGemini
what is a virtual class?
In multiple inheritance when a class D is derived by two base classes B and C and both base class is also inherite by same class A then then class D will get duplicate copy of uppper most base class A.In this case class A will declare as virtual class
What is the difference between ExecuteReader,ExecuteNonQuery
and ExecuteScalar.
ExecuteReader - This method returns a DataReader which is filled with the data that is retrieved using the command object.
ExecuteNonQuery - This method returns no data at all. It is used majorly with Inserts and Updates of tables.
ExecuteScalar - Returns only one value after execution of the query. It returns the first field in the first row.
can i use store procedure in disconnected mode?
Store procedure is used in disconnected mode because procedure are compiled only once and it is used in dataset also
difference between
in Web.Config can be used to store Settings which are applicable for the whole Application
is a node within in the Web.config
it can be used to store the Connection String
How to handle error while project running on live
Only using application error log file and to show internal server error
can we add connection string in global.asax?????????? 2.what are the default files included when we create new web application????
We can't add connection string in global.asax file. we can create
connection string in web.config file only.
global.asax,web.config,Default.aspx files and
app_code,app_data,app_themes folders.
What is the difference between Remoting & Web Servcies?
Web Services:

- accessed only over HTTP
- work in a stateless environment
- support only datatypes defined in the XSD type system
- support interoperability across platforms
- highly reliable
- easy to create and deploy
Remoting:
- can be accessed over any protocol
- support for both stateful and stateless environment
- support for rich type system
- homogenous environment
- if IIS is not used, application needs to provide plumbing for
ensuring the reliability
- complex to program
What is the roll of JIT in asp.net?
JIT allows parts of your application to execute when they are needed.
JIT convert Intermediate languge(IL) to machine code at run time or at
the point where the software is installed.
Suggest 3 best practices in detail for for Developing High
Performance Web and Enterprise Applications
Used Disconnected architecture like dataset
Used as possible as All HTML controls
Used all client side validations only
Used cursors for more than one rows
Used Cache for maintain state which is came from database
Developing Applications using Classes.[It means 3tire architecture]
Using JavaScript and XML when the designing and implementing webpages.
Using Stored Procedures to generate a call to DataBase.
My website has around 100 aspx. Out of this, a certain 20 aspx
files should be made available to the users only if they are
logged in

What is purpose of xml control in standard controls of asp.net?
Actually all data is transfer from place to other place in the form of xml formate so it is very easy to transfer
What Are The Difference Between AutoEventWireup="true" and
AutoEventWireup="False"
if the AutoEventWireup="true" propety in dropdown when index changed automatically post back to the server.
if the AutoEventWireup=" False" propety in dropdown when index changed will not post back to the server.
How many Controls present in Asp dot net?
There are three types of control in ASP.NET
1.- USER CONTROL (.ASCX)
2.- CUSTOM CONTROL (.DLL)
3.- WEB CONTROL
If Asp Dot Application is stateless what happened? during designing
asp.net is stateless Both ASP and ASP.NET are stateless. Because both ASP and ASP.NET uses HTTP protocol which is stateless
how can i am search the data from database? just like google
SELECT * FROM EMPLOYE WHERE DETAILS LIKE '%%'
This is the simplest query for that...
what is tag?
It allows you to specify configuration details for particular folder or file in the Web.config file.
What is Active Directory? What is the namespace for that?
Active Directory Service Interfaces (ADSI) is a programmatic interface for the Microsoft Windows Active Directory. It enables your applications to interact with different directories on a network using a single interface.
Namespace:
-----------
System.DirectoryServices
Explain Generics?
The most common use of generics is to create collection classes.
Generics does not require boxing and unboxing while inserting and
retrieving elements.
By Performane wise Generics were fast
Generics are type safety.
With out Web.config can we executes the application?
Yes, application will inherit cofiguration setting from machine.config
file
if our web.config does not contain any connectionStrings then we can
run the application with out web.confing file
What is the Impersonation?and what is the importence of that?
Impersonation is nothing but applying different themes and skins to a particular web page or website.
Can we use the java script code in .Net Code behind?
yes we can use javascript in code behind.
Define the script block that contains the JavaScript function. You can add this directly to the HTML of the page.
Insert the script block by the
Page.RegisterStartupScript() or the
Page.RegisterClientScriptBlock() method.
or by using updatepanel by raising an async postback using JavaScript code
What is Runtime callable wrapper?
A Runtime Callable Wrapper (RCW) is a proxy object generated by the .NET Common Language Runtime (CLR) in order to allow a Component Object Model (COM) object to be accessed from managed code. Although the RCW appears to be an ordinary object to .NET clients, its primary function is to marshal calls between a .NET client and a COM object.
For example, a managed application written in C# might make use of an existing COM library written in C++ or Visual Basic 6, via RCWs.
what is COM Object in Dot net?
Component Object Model is a method to facilitate communication between different applications and languages.
The following steps explain the way to create the COM server in C#:
Create a new Class Library project.
Create a new interface, say IManagedInterface, and declare the methods
required. Then provide the Guid (this is the IID) for the interface
using the GuidAttribute defined in System.Runtime.InteropServices.
The Guid can be created using the Guidgen.exe. [Guid("3B515E51-0860-
48ae-B49C-05DF356CDF4B")]
Define a class that implements this interface. Again provide the Guid
(this is the CLSID) for this class also. Mark the assembly as
ComVisible. For this go to AssemblyInfo.cs file and add the following
statement [assembly: ComVisible (true)]. This gives the accessibility
of all types within the assembly to COM.Build the project. This will
generate an assembly in the output path. Now register the assembly
using regasm.exe (a tool provided with the .NET Framework)- regasm
\bin\debug\ComInDotNet.dll \tlb:ComInDotNet.tlb This will create a
TLB file after registration.Alternatively this can be done in the
Project properties -> Build -> check the Register for COM interop.
The COM server is ready. Now a client has to be created. It can be in
any language. If the client is .NET, just add the above created COM
assembly as reference and use it.
What command line used to generate Runtime callable wrapper.
tlbimp.exe,
for example:
tlbimp
InteropExample.dll /output:InteropExampleRCW.dll /verbose
What is the difference between Postback and Ispostback Property?
PostBack: Postback is the event which sends the form data to the server. The server processes the data & sends it back to the browser. The page goes through its full life cycle & is rendered on the browser. It can be triggered by using the server controls.
And the IsPostBack property of the page object may be used to check whether the page request is a postback or not. IsPostBack property is of the type Boolean.
What is CTE in sql server 2005?
Common Table Expressions, It is return temporary result set from inside a statement.
which one is faster execute reader, scalar, execute non query ?
can machine.config file orverrides web.config. For example: if u set
session timeout as 30 mins in web.config file to a particular
application and if u set session timeout as 10 mins in machin.config.
what will happen and which session is set to the appliction?
As the Web.Config file defines application level settings.It'll override the settings of the machine.config file.So the session timeout as 30 mins defined in web.config file is set to the application.
Is There any Third party tools are using in .Net Technologies? Can u Explain?
The name of the Third Party Tool is Telerik Controls.
How to refresh a page in asp.net
by using ispostback property or by using ajax controls
by calling javascript function in asp.net you can also refresh page
How can i include both C# and vb.net classes in same solution?
Step 1:
It is possible,In app-Code folder create sub folders named VB,CS(as you like) and create .vb class files in the folder named VB and .cs class files in the CS folder.
Step 2:
Go to web.config file and mention the following




Difference between Stored procedures and User Defined functions[UDF]
Stored procedureA stored procedure is a program (or procedure) which is physically stored within a database. They are usually written in a proprietary database language like PL/SQL for Oracle database or PL/PgSQL for PostgreSQL. The advantage of a stored procedure is that when it is run, in response to a user request, it is run directly by the database engine, which usually runs on a separate database server.
User-defined functionA user-defined function is a routine that encapsulates useful logic for use in other queries. While views are limited to a single SELECT statement, user-defined functions can have multiple SELECT statements and provide more powerful logic than is possible with views.In SQL Server 2000User defined functions have 3 main categories
Scalar-valued function - returns a scalar value such as an integer or a timestamp. Can be used as column name in queries
Inline function - can contain a single SELECT statement.
Table-valued function - can contain any number of statements that populate the table variable to be returned. They become handy when you need to return a set of rows, but you can't enclose the logic for getting this rowset in a single SELECT statement.
Differences between Stored procedure and User defined functions
UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
Inline UDF's can be though of as views that take parameters and can be used in JOINs and other Rowset operations.
Of course there will be Syntax differences and here is a sample of that
Stored procedure Code: SQL
CREATE PROCEDURE dbo.StoredProcedure1
/*
(
@parameter1 datatype = default value,
@parameter2 datatype OUTPUT
)
*/
AS
/* SET NOCOUNT ON */
RETURN
User defined functions Code: SQL
CREATE FUNCTION dbo.Function1
(
/*
@parameter1 datatype = default value,
@parameter2 datatype
*/
)
RETURNS /* datatype */
AS
BEGIN
/* sql statement ... */
RETURN /* value */
END
Can we change the session timeout in ASP.NET, if yes then how and from where?
By default session time out is 20 minutes but one can change it. there are two ways to change the sessiontime out in asp.net that is:-
1) from web config. file by setting the session timot element eg.

or
2) by doing programtically eg.
session.timeout=60
What is three major points in WCF?
1) Address --- Specifies the location of the service which will be like http://Myserver/MyService.Clients will use this location to communicate with our service.
2)Contract --- Specifies the interface between client and the server.It's a simple interface with some attribute.
3)Binding --- Specifies how the two paries will communicate in term of transport and encoding and protocols.
0 comments

No comments:

.

.