Deloittte Interview Questions on .. Net {3+yrs experienced}

Answer Posted / dhanunjaya g

Answers :

1)Types of Session state mode?

Ans>

InProc mode, which stores session state in memory on the Web
server. This is the default.

StateServer mode, which stores session state in a separate
process called the ASP.NET state service. This ensures that
session state is preserved if the Web application is
restarted and also makes session state available to multiple
Web servers in a Web farm.

SQLServer mode stores session state in a SQL Server
database. This ensures that session state is preserved if
the Web application is restarted and also makes session
state available to multiple Web servers in a Web farm.

Custom mode, which enables you to specify a custom storage
provider.

Off mode, which disables session state.


2)In which database sql server session will be stored?


Ans>session state is stored in the tempdb database of SQL
Server.


3)How to call javascript from c# code under button_click
without using
Button1.Attributes.Is there any method?

Ans>
string strsql = "<Script language = 'javascript'> lovechild
=
window.open('Default.aspx','','width:150px,resizable=no,scroolbar=no'
) ; </Script> ";
this.Response.Write(strsql);

4)How to call javascript function from webform1 to webform2?
Ans>
Using Submit Form Method :
You can submit the form in Webform1.aspx to webform2.aspx.
In that case,
you can retrieve all the WebForm1's form element from webform2.
What we will do in the below example is to add another form
( not a server side one)
which will have two HTML controls;
the first is an submit control the second is a hidden
field which will have the value of TextBox1 web server
control to be posted to webform2

Ex: now the HTML code of webform1 will look like below

<form id="Form1" method="post" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</form>
<form name="SubmittedForm" action="WebForm2.aspx"
method="post">
<input id="Submit1" type="submit" value="submit"
onclick="CopyTextToHiddenField()" />
<input name="Hidden1" type="hidden" />
</form>

Of course you realized the we handled the onclick event of
the submit button which will
call a javascript function to copy the value of TextBox1
into the hidden field (Hidden1) in order to post it to
webform2.
Also you so in the second form tag the action attribute in
which we specified to which
page the second form (SubmittedForm) will be posted.

Add the below javascript code
inside the <head> tag of WebForm1

<script language="javascript">
function CopyTextToHiddenField()
{
var textbox1Value =
document.getElementById("<%=TextBox1.ClientID%>").value;

document.forms[1].document.getElementById("Hidden1").value =
textbox1Value;
}
</script>

Now you retrieve the value of
"Hidden1" hidden field in webform 2 using the below code


Response.Write(Request.Form["Hidden1"]);



5)Webserver controls and Html controls differences?

U can get more difference here
http://www.dotnetspider.com/forum/19765-Difference-between-web-control-server-control-Html-control.aspx


6)CCW,RCW why to use com components when we can manage
everything with dlls?

ans> We can't manage Everthing with dlls .becz few problems
will face when handling with dlls
Forex: DLL hell and etc .
so,
A .NET component, however, is a pre-compiled class module
with a .DLL (dynamically-linked library) extension.
At run time, a .NET component is invoked and loaded into
memory to be used by some consumer application.

you may have a single DLL that supports error handling in
your applications. In this case,
the DLL exposes a single ErrorHandler class that performs
all of the error handling required by consumer applications.

So,.Net Components can't communicate with Com directly,so
we can do using RCW (Runtime callable Wrapper) and CCW .


7)View state how u make that so that view state in page can
not be tampered?
Ans>
Administrator wants to make a security check that no one has
tampered with ViewState, how can we ensure this?
Microsoft has provided two mechanisms for increasing the
security of ViewState.
a) Machine Authentication Check (MAC) - tamper-proofing <%@
Page EnableViewStateMac="true"%>
b) Encrypting the ViewState This encryption can only be
applied at the machine.config level, as follows: <machineKey
validation='3Des' />



8)which session state mode you used in your current project?why?
ans> it depends on your project . by default InProc mode.

9)Diffrences between UDF and Stored procedures?



1>Procedure can return zero or n values whereas function can
return one value which is mandatory.

2>Procedures can have input,output parameters for it whereas
functions can have only input parameters.

3>Procedure allow select as well as DML statement in it
whereas function allow only select statement in it.

4>Functions can be called from procedure whereas procedures
cannot be called from function.

5>Exception can be handled by try-catch block in a procedure
whereas try-catch block cannot be used in a function.

6>We can go for transaction management in procedure whereas
we can't go in function.

7>Procedures can not be utilized in a select statement
whereas function can be embedded in a select statement.


11)Difference between temporary table and derived table?
Ans)
1>Using temp table you can able insert the value only at
runtime.
derived table you can insert the data anytime and view also
anytime.

2>Explicit Indexing and Constraints are allowed in temp tables.
Explicit Indexing and Constraints are not Applicable In
Derived tables.

Is This Answer Correct ?    40 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi.. Guys Im pranitha, presently im working in a organisation & im look for job at MNC's like DELL, Delloitte, Bank of America, Genpect, etc., I have completed B.com . Pls help me...

1133


speak 1min on topic Travelling,memorable moment ,memorable day?

1731


aptitude

686


your project to describe and tell about : 1. My favorite things 2. My favorite places at home 3. Animals *Choose one of them to describe *Write on your paper *If you done, Send me *Did you get it

776


my question is : reverse a string in COBOL program (please write a code asap) input file: 1234abcdef abc*$#1___ cdef____ghi a_z_k_h___ 4_3_2_1___ ______5678 output file: 8765_____ 1_2_3_4__ h_k_z_a__ ihg____ghi 1#$*cba__ fedcb4321

1182






what is difference between uv and visible spectroscopy and how to differentiate the drug compounds in uv visible region

1585


What were the occupations of the people who lived within the Mauryan Empire?

570


Danlaw placement questions and answers

1343


What kind of Issues/bugs arise in ETL projects? I would like to know few issues (critical to somewhat bugs ) normally occur in ETL process especially when testing? Domains can be banking, retail or any.

1412


i want the sample placement paper of goldman sachs urgently. please send it to me

3918


printf("%d",printf("%d",printf("%d",printf("%s","ILOVECPROGRAM")))); whats the output

1387


what is bidirectional?

1376


Sks Microfinance

971


what you will do when you struck in traffic ?

1037


What are the frequently asked questions for interview in capital iq company ?

1312