Monday, April 26, 2010

JSP FAQ


. What is JSP ? Describe its concept.

2 . Explain the benefits of JSP?

3. Is JSP technology extensible?

4 .Can we implement an interface in a JSP?

5 What are the advantages of JSP over Servlet?

6. Differences between Servlets and JSP?

7 . Explain the differences between ASP and JSP?

8 . Can I stop JSP execution while in the midst of processing a request?

9. How to Protect JSPs from direct access ?

10. Explain JSP API ?

11. What are the lifecycle phases of a JSP?

12. Explain the life-cycle mehtods in JSP?

13. Difference between _jspService() and other life cycle methods.

14 What is the jspInit() method?

15. What is the _jspService() method?

16. What is the jspDestroy() method?

17. What JSP lifecycle methods can I override?

18. How can I override the jspInit() and jspDestroy() methods within a JSP page?

19 . Explain about translation and execution of Java Server pages?

20 . Why is _jspService() method starting with an '_' while other life cycle methods do not?

21. How to pre-compile JSP?

22. The benefits of pre-compiling a JSP page?

23.How many JSP scripting elements and explain them?

24. What is a Scriptlet?

25. What is a JSP declarative?

26. How can I declare methods within my JSP page?

27. What is the difference b/w variable declared inside a declaration and variable declared in scriplet ?

28.What are the three kinds of comments in JSP and what's the difference between them?

29. What is output comment?

30. What is a Hidden Comment?

31. How is scripting disabled?

32. What are the JSP implicit objects?

33. How does JSP handle run-time exceptions?

34. How can I implement a thread-safe JSP page? What are the advantages and Disadvantages of using it?

35. What is the difference between ServletContext and PageContext?

36 . Is there a way to reference the "this" variable within a JSP page?

37 . Can you make use of a ServletOutputStream object from within a JSP page?

38 .What is the page directive is used to prevent a JSP page from automatically creating a session?

39. What's a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or Synchronization?

40. What are various attributes Of Page Directive ?

41 . Explain about autoflush?

42. How do you restrict page errors display in the JSP page?

43. What are the different scopes available fos JSPs ?

44. when do use application scope?

45. What are the different scope valiues for the ?

46. How do I use a scriptlet to initialize a newly instantiated bean?

47 . Can a JSP page instantiate a serialized bean?

48.How do we include static files within a jsp page ?

49.In JSPs how many ways are possible to perform inclusion?

50.In which situation we can use static include and dynamic include in JSPs ?

51.Differences between static include directive and include action ?

Monday, March 8, 2010

Vb Script to call a web service

Dim oXMLDoc, oXMLHTTP

Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
Set oXMLDoc = CreateObject("MSXML2.DOMDocument")
Msgbox("Calling WebService ")
oXMLHTTP.onreadystatechange = getRef("HandleStateChange")
call oXMLHTTP.open ("POST","http://localhost:1673/WebService1.asmx/Helloworld",false)
call oXMLHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
'send input parameters
oXMLHTTP.send "a=1"


Sub HandleStateChange
if(oXMLHTTP.readyState = 4) then
dim szResponse
szResponse = oXMLHTTP.responseText
call oXMLDoc.loadXML(szResponse)
if(oXMLDoc.parseError.errorCode <> 0) then
call msgbox(oXMLDoc.parseError.reason)
else
msgbox(oXMLDoc.getElementsByTagName("string")(0).childNodes(0).text)
end if
end if
End Sub

Thursday, February 18, 2010

Remoting FAQ

What is Application domain?
In application domains Multiple appication can run in same process with out influencing each other.If one of the application domain throws error it doesnot affect aother applicaation domain.TO invoke method in a objec wunning in differnt application domain .Net remoting is used.
What is .NET Remoting
.Net remoting is the replacement of DCOM.Using .Net remoting we can make remote object calls to the methodsthat are running in differnt application domains.As the remote objects run in differnt process client callingthe remote object canot call it directly.so the client uses a proxy which looks like a real object.

when a client want to make a method call on the remote object it uses proxy of it.These method call are called "Messae".Messages are serialized using "formatter" class and sent to the client "chanel".Client channel communicate with the server channel.Server channel uses a formatter class to deserialize themessage and send to remote object.

which class does remote object to inherit?
All remote objects must inherit System.MarshallByRefObject Class

what are two differnt types of remote objects creation mode in .net?
The two different types of remote objects creation are
Server Activated Object mode
Client activated Object mode
Server Activated object is also called as "Call mode".In this type of creation we have two differnt modes ofcreating object."Single Call" and "Singleton".
In single Call mode object is created for every method call hence it is stateless.In Singleton mode object is created only once and it is shared to all clients.
Client activated objects are statefull.In CAO the creation request is sent from clientside. Client holds a proxy to the server object created on server.

Describe in detail Basic of SAO architecture of Remoting?
Left to user.

What is fundamental of published or precreated objects in Remoting?
In scenarios of singleton or single call the objects are created dynamically. But in situationswhere you want to precreate object and publish it you will use published object scenarios.
Dim obj as new objRemoteobj.Initvalue = 100
RemotingServices.Marshal(obj,”RemoteObject”)
RemotingServices.Marshal(obj,”RemoteObject”)
where “obj” is the precreated objectedon the server whose value is initialized to 100

What are the ways in which client can create object on server in CAOmodel ?
Activator.CreateInstance(). By Keyword “New”.

In CAO model when we want client objects to be created by “NEW”keyword is there any precautions to be taken ?
Remoting Clients and Remoting Server can communicate because they share a commoncontract by implementing Shared Interface or Base Class.
But according to OOP’s concept we can not create a object of interface or Base Classes
Shipping the server object to client is not a good design practice. InCAO model we can use SOAPSUDS utility to generate Metadata DLL from server whichcan be shipped to client, clients can then use this DLL for creating object on serverRunthe SOAPSUDS utility from visual studio command prompt for syntax see below :-
soapsuds -ia:RemotingServer -nowp -oa:ClientMetaData.dll
Where RemotingServer is your server class name.ClientMetaData.dll is the DLL name by which you will want to create the metadll.

What are LeaseTime, SponsorshipTime, RenewonCallTime and LeaseManagerPollTime

In normal .NET environment objects lifetime is managed by garbage collector. But in remoting environment remote clients can access objects which are out of control ofgarbage collector. Garbage collector boundary is limited to a single PC on which frameworkis running; any remote client across physical PC is out of control of GC (GarbageCollector).

This constraint of garbage collector leads to a new way of handling lifetime for remotingobjects, by using concept called as “LeaseTime”. Every server side object is assigned bydefault a “LeaseTime” of five minutes. This leasetime is decreased at certain intervals.Again for every method call a default of two minutes is assigned. When i say method callmeans every call made from client. This is called as “RenewalOnCallTime”.Let’s put the whole thing in equation to make the concept more clear.
Total Remoting object life time = LeaseTime + (Number of method calls) X(RenewalTime).

If we take NumberOfMethodCalls as one.159
Then default Remote Object Life Time = 5 + (1) X 2 = 10 minutes (Everything is inminutes)
When total object lifetime is reduced to zero, it queries the sponsor that should the objectbe destroyed. Sponsor is an object which decides should object Lifetime be renewed. Soit queries any registered sponsors with the object, if does not find any then the object ismarked for garbage collection. After this garbage collection has whole control on theobject lifetime. If we do not foresee how long a object will be needed specify the“SponsorShipTimeOut” value. SponsorShipTimeOut is time unit a call to a sponsor istimed out.
“LeaseManagerPollTime” defines the time the sponsor has to return a lease time extension.

Which config file has all the supported channels/protocol ?
Machine.config file has all the supported channels and formatter supported by .NETremoting.Machine.config

What is a Web Service ?
Web Services are business logic components which provide functionality via the Internetusing standard protocols such as HTTP.Web Services uses Simple Object Access Protocol (SOAP) in order to expose the businessfunctionality.SOAP defines a standardized format in XML which can be exchangedbetween two entities over standard protocols such as HTTP. SOAP is platform independentso the consumer of a Web Service is therefore completely shielded from anyimplementation details about the platform exposing the Web Service. For the consumer itis simply a black box of send and receive XML over HTTP. So any web service hosted onwindows can also be consumed by UNIX and LINUX platform.


What the different phase/steps of acquiring a proxy object inWebservice
Client communicates to UDI node for WebService either through browser orUDDI's public web service.
UDII responds with a list of webserviceEvery service listed by webservice has a URI pointing to DISCO or WSDLdocument
After parsing the DISCO document, we follow the URI for the WSDL documentrelated to the webservice which we need.
Client then parses the WSDL document and builds a proxy object which cancommunicate with Webservice.


What is WSDL?
Web Service Description Language (WSDL)is a W3C specification which defines XMLgrammar for describing Web Services.XML grammar describes details such as:-
Where we can find the Web Service (its URI)?
What are the methods and properties that service supports?
Data type support. Supported protocols


What is DISCO ?
DISCO is the abbreviated form of Discovery. It is basically used to club or group commonservices together on a server and provides links to the schema documents of the servicesit describes may require.

What is UDDI ?
Full form of UDDI is Universal Description, Discovery and Integration. It is a directorythat can be used to publish and discover public Web Services
What is ObjRef object in remoting ?
All Marshal() methods return ObjRef object.The ObjRef is serializable because itimplements the interface ISerializable, and can be marshaled by value. The ObjRef knowsabout :-
√ location of the remote object
√ host name
√ port number
√ object name.

Wednesday, February 10, 2010

Normalization

Normalization:

A series of steps followed to obtain a database design that allows for efficient access and storage of data in a relational database

Normalization helps
to optimize the database by thorugh investigation of relation ships.
It is used mainly to avoid redundacy of data and for scalability issues,

The Process towards database Normalization Progresing through series of Steps typically Known as Normal forms.




First Normal Form

‘A relation R is in first normal form (1NF) if and only if all underlying domains contain atomic values only.’

the first rule call for elimination of repeating groups of data through the creation of seperate tables of related data


Second Normal Form

‘A relation R is in second normal form (2NF) if and only if it is in 1NF and every nonkey attribute is fully dependent on the primary key.’



Third Normal Form

‘A relation R is in third normal form (3NF) if and only if it is in 2NF and every nonkey attribute is nontransitively dependent on the primary key.’

Boyce/Codd Normal Form

‘A relation R is in Boyce/Codd normal form (BCNF) if and only if every determinant is a candidate key.’

Type Casting in C#.net

TypeCasting:
Typecasting is the name given to transforming one type into another. There are two types of casting that can be performed on data types,
implicit and explicit

Implicit Typecast
Implicit casting is performed by the compiler when there is no possible loss of data. This is when a smaller data type is copied into a larger data type - e.g., converting a 16-bit short to a 32-bit integer value

Expilicit TypeCast:
Explicit casting requires the use of the cast operator (parentheses) when there is a possible loss of data
int fourBytes = 0x000000FE;
byte lowestByte = (byte)fourBytes;

int numericval=67;
byte bytevalue= (byte) numericvalue;

String to Byte Array Conversion in C# and VB.NET :

Convert string to byte Array in C#.net
public static byte[] StrToByteArray(string str){
System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
return encoding.GetBytes(str);
}

Converting Byte Array to String:
byte [] dBytes = ...
string str;
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
str = enc.GetString(dBytes);


Convert Integer to Byte :
Use BitConverter to convert integer values to byte
byte[] numBytesBuf = new byte[4];
numBytesBuf =System.BitConverter.GetBytes(int32Input);

Convert bitarray to Int

BitConverter.ToInt32 Method
Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.

Infosys Scholarship

Infosys Scholarship for Poor Students who completed 10th std.-Pls. Read & Forward to benefit the needy Dear Friends, If you have come across any bright students coming from poor financial background who have finished their 10th standard this year (April 2009) and scored more than 80%, please ask them to contact the NGO-Prerana (supported by Infosys foundation). The NGO is conducting a written test and those who clear the test will be eligible for financial help for their further studies.


Please ask the students to contact the people mentioned below to get the form #580,


Shubhakar , 44th cross,1st A main road,jayanagar 7th block Bangalore
Mob no- 9900906338(saraswat i)
Mr. Shivkumar ( 9986630301) - Hanumanthnagar office
Ms. Bindu (9964534667 )-Yeshwantpur office


Even if you dont know anyone, please pass on this info, someone might be in need of this help desperately

Sunday, February 7, 2010

Tuesday, February 2, 2010

Web Services Brief discussion

WebService :
A Web service is a software system designed to support interoperable machine-to-machine interactionover a network.It has an interface described in a machine processable format(WSDL).Other systems intercat with the web service in the manner described by its description using SOAP messages,conveyed using HTTP with an XML serialization in conjunction with other Web related standards.


Why do we use Web Services Instead of DCOM :
Both technologies are from two different technology time zones. COM, DCOM and COM+ are based on the COM architecture (VB6, ATL, C++, MFC), and available in the pre–. NET era, while .NET Remoting is primarily based on .NET Frameworks.
DCOM has drawbacks in the internet connected world because DCOM depends on proprietary binary protocol, which is not supported by all object models and compromises with interoperability across platforms and on the internet, an area where DCOM has severe problems. However, DCOM works well when application systems of similar types exist on the same network. Moreover, DCOM is hard to learn and complicated to deploy, to maintain and to explore.
.NET Remoting supports a set of transport and communication protocols and is more adaptable and easy to deploy to network environments and relatively easy to learn and achieve mastery. DCOM relies on frequent pinging of clients to manage remote object lifetime, where .NET Remoting relies on simple and more efficient leasing mechanisms to maintain object lifetime. DCOM is a closed system, offering little in the way of extensibility, .NET Remoting architecture is much easier to use and extend than DCOM.
Finally, until the arrival of .NET Frameworks, Microsoft's primary protocol for intelligent inter-process communication across systems was Distributed COM. Certainly, DCOM has had some success through pain, and had its day; distributed computing in the Microsoft world will depend on .NET Remoting and Web Services.

Web Service Description :
The mechanics of the message exchange are documented in a Web service description (WSD).The WSD is a machine-processable specification of the Web service's interface, written in WSDL. It defines the message formats, datatypes, transport protocols, and transport serialization formats that should be used between the requester agent and the provider agent. It also specifies one or more network locations at which a provider agent can be invoked, and may provide some information about the message exchange pattern that is expected. In essence, the service description represents an agreement governing the mechanics of interacting with that service.


Semantics :
The semantics of a Web service is the shared expectation about the behavior of the service, in particular in response to messages that are sent to it. In effect, this is the "contract" between the requester entity and the provider entity regarding the purpose and consequences of the interaction. Although this contract represents the overall agreement between the requester entity and the provider entity on how and why their respective agents will interact, it is not necessarily written or explicitly negotiated.
While the service description represents a contract governing the mechanics of interacting with a particular service, the semantics represents a contract governing the meaning and purpose of that interaction


Steps how WebServices utilised:
1.The requester and provider entities become known to each other
2.The requester and provider entities agree on the service description and semantics that will govern the interaction between the requester and provider .
3.The service description and semantics are realized by the requester and provider agents
4.The requester and provider agents exchange messages, thus performing some task on behalf of the requester and provider entities

Thursday, January 28, 2010

FAQ-3

1. ctype(123.34,integer) - should it throw an error? Why or why not?
No,It is valid conversion

2. directcast(123.34,integer) - should it throw an error? Why or why not?
Yes,doulbe is not inhertited from integer both are of not same types,

3. Difference between a sub and a function
Sub doesnt return value,Where as function Returns

4. Explain manifest & metadata.
Manifest describes Assembly,security,Versioning,Culture,StrongNames
Metadata destcribes content in Assembly ,classes,enums,interfaces

5.What happens in memory when you Box and Unbox a value-type
Boxing converts valuetype to reference type ,thus storing object to heap.
Unboxing converts reference type to Value Type thus storing object on Stack.

6.What namespaces are necessary to create a localized application?
System.Resources

7.What namespaces are required to work with dll?
System.InteropServices.

8.Scope of public/private/internal/protected/protected internal
public
The type or member can be accessed by any other code in the same assembly or another assembly that references it.
private
The type or member can only be accessed by code in the same class or struct.
protected
The type or member can only be accessed by code in the same class or struct, or in a derived class.
internal
The type or member can be accessed by any code in the same assembly, but not from another assembly.
protected internal
The type or member can be accessed by any code in the same assembly, or by any derived class in another assembly.

9.Difference between imperative and interrogative code

Imperative -Return value
Interrogative -Doesnot return value

10.What is Raise event
Raise Event is used for raising events. ex raising control event from main page .
11.Describe ways of cleaning up objects
GC.collect
Finalize
Dispose methods

12.Where does Dispose method lie?
The dispose method is available in System.IDisposable interface.If you want to provide cleanup mechanism then implement this interface and provide the definition for dispose() method

13.Can you configure a .NET Remoting object via XML file?
Yes, via machine.config and web.config in ASP.NET. Application-level XML settingstake precedence over machine.config.

14.Explain Web.config Settings for exception management in ASP.NET.

You should configure exception management settings within your application's Web.config file. The following is an example of the exception settings in a Web.config file.
< defaultredirect="http://hostname/error.aspx" mode="On">
< statuscode="500" redirect="/errorpages/servererror.aspx">
< statuscode="404" redirect="/errorpages/filenotfound.htm">
< /customErrors>

In the customErrors element, specify a default redirect page. There are three modes for the default redirect page:
On -Unhandled exceptions will redirect the user to the specified defaultredirect page. This is used mainly in production.
Off-Users will see the exception information and not be redirected to the defaultredirect page. This is used mainly in development.
RemoteOnly- Only users accessing the site on the local machine (using localhost) will see the exception information while all other users will be redirected to the defaultredirect page. This is used mainly for debugging.

15.What are Generics?
Generics are used to have Typed Arrays.
Ex: if we have define that an array is confined to products.if we push objects of product into array it accepts.if we push employee objects into this array it will showerror . since the type of the array is product

17.What is Global Assembly Cache (GAC) and what is the Purpose of it?
The GAC or the Global Assembly Cache in .NET Framework acts as the central place for registering assemblies.It enables you to share assemblies across numerous applications

18.How to find methods of a assembly file not using ILDASM
Using system.reflection

19.What is use of ContextUtil class?
ContextUtil is the preferred class to use for obtaining COM+ context information.

20.How do you turn off cookies for one page in your site?
Cookie.Discard

Difference between DirectCast and CType


The difference between the two keywords is that CType succeeds as long as there is a valid conversion defined between the expression and the type and DirectCast requires that the run-time type of an object variable to be the same as the specified type that it's being cast to.


The first thing to understand is that CType and DirectCast are not the same thing. Only CType can convert the underlying object to a new instance of an object of a different type. For example, if you want to turn an integer into a string. Since an Integer doesn't inherit a String, a new instance of a String object must be created in order to store the number as a String. CType can do this, DirectCast cannot. Note: There are other ways to do this too such as the
Convert.ToString method or CStr().


Dim MyInt As Integer = 123
Dim MyString1 As String = CType(MyInt, String)
Dim MyString2 As String = DirectCast(MyInt, String) ' This will not work


What DirectCast and CType do have in common is their ability to convert an object to a new type based on inheritance or implementation.

For example, if you have a String but it is stored in a variable of type Object, you can use DirectCast or CType to treat that variable as an object of type String because type String inherits type Object. In this case, the underlying data in memory is not actually changing, nor is any processing happening on that data.

Dim MyObject As Object = "Hello World"
Dim MyString1 As String = CType(MyObject, String)
Dim MyString2 As String = DirectCast(MyObject, String) ' This will work,since string is inherited from object


Retrieving Hierarchical Data in SQL

Hi,

I am adding the stored procedure to retrieve hierarchical data,
Scenario:
Employees working under manager
**********************************************************

USE [SampleDB]
GO
/****** Object: StoredProcedure [dbo].[ShowHierarchy] Script Date: 01/28/2010 17:45:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[ShowHierarchy]
(
@Root int
)
AS
BEGIN
SET NOCOUNT ON
DECLARE @EmpID int, @EmpName varchar(30)
-- SET @EmpName = (SELECT H_Firstname FROM dbo.LM_EmployeeDetails WHERE H_ID = @Root)
(SELECT @EmpName=H_Firstname FROM EmployeeDetails WHERE ID = @Root)
PRINT REPLICATE('-', @@NESTLEVEL * 4) + @EmpName
SET @EmpID = (SELECT MIN(H_ID) FROM EmployeeDetails WHERE Manager_ID = @Root)
WHILE @EmpID IS NOT NULL
BEGIN
EXEC dbo.ShowHierarchy @EmpID
SET @EmpID = (SELECT MIN(H_ID) FROM EmployeeDetails WHERE Manager_ID = @Root AND ID > @EmpID)
print @empid
END
END


***************************************************
Pass employeeId as parameter to get tree structure of subbordinates working under the employee.

C#.net FAQ

1. Are C# constructors inherited?
No. C# constructors cannot be inherited.

2.Are C# parameters passed by reference or by value?
Default By value

3.Can a property have different get and set access?
Previous version of .net 2.0 nofor others we can have.

4.Can const and static be used together?
No. constant are implicitly static declaring again as static leads confusion

5.Can I directly call a native function exported from a DLL?
Yes.
The following example uses the minimum requirements for declaring a C# method implemented in a native DLL.

using System.Runtime.InteropServices;
class Test{ [DllImport("user32.dll")]
public static extern int MessageBoxT (int h, string m, string c, int type);
public static int Main()
{ return MessageBoxT(0, "Hello, World!", "Title", 0); }
}


The method Test.MessageBoxT() is declared with static and external modifiers. And, it has the DllImport attribute which notifies the compiler that the implementation comes from the user32.dll under the default name of MessageBoxT.

6.How can I force garbage collection?
GC.Collect()

7.How can I output simple debugging messages?
Trace.write methods of Syste.diagnostics class

8.How can one constructor call another?
To call one C# constructor from another, before the body of the constructor, use either:
: base (parameters)to call a constructor in the base class; or:
: this (parameters)

9. How check the object type at runtime?
The is keyword is used for this purpose.
Isinteger

10.How can type name clashes be resolved?
The C# using keyword can be used to supply hints to the C# compiler regarding the fully qualified names of types residing in a specified source (.cs) file. The using keyword can include an alias which can be used to prevent or resolve name clashes.

11.How do destructors work in C#?
A destructor is a method that is called when an object is destroyed—it's memory is marked unused. In .NET, the Garbage Collector (GC) performs much of this type of work automatically

12.How do I declare an out variable?
An out parameter is used to return a value in the same variable which was passed in as a parameter to the method. Any changes made to the parameter are reflected in the variable

13.How do I get DllImport to work?
Reference System.Runtime.InteropServices. Mark all methods with the DllImport attribute as public static extern.

14.How do I make a C# DLL?
Use the /target:library compiler option.
In Visual Studio,
open the Project File's property page;
open CommonProperties -> General -> Output Type;
change the output type to class library;
build the application to create a .dll file.

15.How do I use trace and assert?
Checks for a condition; if the condition is false, displays a message box that shows the call stack.

16.How get the type name at runtime?
To get the name of a C# type at runtime, use the GetType() method of object class.

17.How keep a local variable in scope across a try-catch block?
Decalre outside try block

18.How make sure C# classes will interoperate with other .NET languages?
Ensure that the C# application code conforms to the CLS.To help achieve compliance, add the [assembly:CLSCompliant(true)] global attribute to all C# source files. This attribute will cause the C# compiler to throw an error if a non-CLS-compliant feature is used.

19.How perform a case insensitive string comparison?
Stirng.compare()

20.How do you declare Global variables?
Using session variables.

21.What is a type alias?
C# defines a number of aliases for intrinsic CLR types. Aliases and types can be used interchangably. They can be mixed together in a single statement

22.What is the difference between const and static readonly?
The value of a static readonly field is set at runtime; therefore, the value can be modified by the containing class. On the other hand, the value of a const field is set to a compile-time constant.

22.What is the difference between delegate and event?
An event offers more restricted access than a delegate. When an event is public, other classes are only able to add or remove handlers for that event: such classes cannot—necessarily—fire the event, locate all the handlers for it, or remove handlers of which they are unaware.


23.What is the difference between GetType() and typeof? ?
GetType() Operates on object
Typeof Operates on type

24.What is the difference between the out and ref parameter modifiers?
Both the out and ref modifiers can be applied to method arguments. And, both imply that the argument will be passed by reference—either as a reference to a value type variable or to a reference type variable. However, the out parameter enables passing in an uninitialized variable and guarantees that it will come back with set to a value.

Wednesday, January 27, 2010

Benefits of Stored Procedure

Benefits of Stored Procedures
Why should you use stored procedures?
Let's take a look at the key benefits of this technology:
Precompiled execution. SQL Server compiles each stored procedure once and then reutilizes the execution plan. This results in tremendous performance boosts when stored procedures are called repeatedly.
Reduced client/server traffic. If network bandwidth is a concern in your environment, you'll be happy to learn that stored procedures can reduce long
SQL queries to a single line that is transmitted over the wire.
Efficient reuse of code and programming abstraction.

Stored procedures can be used by multiple users and client programs. If you utilize them in a planned manner, you'll find the development cycle takes less time.
Enhanced security controls. You can grant users permission to execute a stored procedure independently of underlying
table permissions.

Delloite interview questions .net

Difference between datareader and Dataset
Difference between ADO.net and ADO
Page Life cycle
WCF Advantages
Ho do you create paging
Do paging have performance over head
What are master pages
What is Clusterd index
Differnce between primary and unique key
How do you trace information of non web components
Is Trace.axd is a page?
How do you declare a global variable?

Wipro Interview questions 2010

  1. What is assembly
  2. What are authentications ? (Mention IIS and .net authentications)
  3. What is singleton class
  4. What are access modifiers explain
  5. Public,private,protected,Protected internal
  6. What is shared assemblies
  7. What is versioning
  8. Difference between ASP and ASP.net
  9. Difference between WebServices and WCF
  10. What is use of Webservice when you have DCOM
  11. How do you retrieve hierarchical data from database
  12. What is static class
  13. difference between abstract class and static class
  14. difference between interface and abstract class
  15. Use of Interface and delegates
  16. How do you handle webservice event in the page
  17. Page Life cycle
  18. Application Life cycle
  19. Session Modes
  20. Five Modes of Trace Switches.

Monday, January 25, 2010

Advantages of using WCF over Web Services

WCF Supports Multiple Bindings like http,tcp,MSMQ etc where as web services uses only http
WCF can maintain transaction like com+ .
It can mainitain state .
It can be hosted on IIS,Selfhosting,Windows Servies(Windows Application Service) .
The development of webservice with ASP.net relies on defining data and relies on the XMLSerializer to transform datato or from a service.
Key Issues of XML Serailizer to serialize .net Types with XML.
-Only Public fields and Properties of .net types can be translated to XML
-Only the classes which implement IEnumerable Interface can be translated to XML.
-Classes implementing IDictionary Interface such as Hash table cannot be serialized.

WCF Uses DataContractAttribute and DataMember Attribute to Translate .net types to XMl.
-DataContract Attribute can be used for classes and structures-DataMember Attribute to Field or Property
Diference between DataContractSerailizer and XML Serializer is
-DCS has better performance over XML Serialization
-XML Serialization doesn't indicate which field or property of the type is serialized, DCS Explicitly shows which field or property is serialized
-DCS can serialize classes implementing IDictionary interface(Hash Table)

Exception Handling
In ASP.NET Web services, Unhandled exceptions are returned to the client as SOAP faults.
In WCF Services, unhandled exceptions are not returned to clients as SOAP faults. A configuration setting is provided to have the unhandled exceptions returned to clients for the purpose of debugging.