Tuesday, January 6, 2009

C# Interview Questions

1.what is read only and constant
Read-Only : i ll take values at run time espessailly u can
use this for date functions

constant : it ll take the values at compile time ,in
constant u cant change values .....

2.What is the minimum size (in bytes) of string data type in c#? Give its compatible data type in .NET Framework.


3.what is stub? what is its use in replics-aware stubs?

A stub is the piece of program develop by the white box tester while merging the modules.

4.what is the difference between serverside scripting and browser side scripting?
Browser script is used for
-> Communication with the user
-> Interaction with the desktop applications
-> Data validation and manipulation limited to the current
record

Where as Server script is used for:
-> Query, Insert and Update operations
-> Access to data beyond the current record

5.what is PICKMAP?
A pickmap defines the correspondence between the originating field and the value field in the picklist generic business component.

6. what is the syntax code to oledb to connect oracle

using system.data.oledb;
oledbconnection cn=new
oledbconnection("uid=;pwd=;server=");
cn.open();

here u declare is u give username
pwd is u give password
or data source is u give

7.Re: what is the syntax code for oldb to connect oracle

using System.Data.Oledb;

Oledbconnection cn=new OleDbConnection
("Provider=Msdaora.1;uid=;pwd=;server=name>");
cn.open();


8.Re: wt is namespace? wt is the use?
NameSpace means a Package.
it contains many supported files
ie.,system.drawing,system.io,etc.
it works like a root/directory.
It is a Continer of Classes,interfaces,subname spaces.etc.
it acts as a Package.


9. what is serilization?

Serialization is the process of saving the state of an object by converting it to a stream of bytes

Strean of Bytes into object is called as deserilization


10.what is garbage collection?
garbage collection is the process of clearing the memory of unused objects, which will be taken care by CLR on periodical basis.
It is use to free the memory of the object r method in use.
it is clr function
it is use to release those objext whitc is not longer useor
no longer refeances in application
it is System.GC.Collaction

11. Re: Can we return two values from a function?

I think yes.. Function can return multiple values.. It's not good practice.. but C# allows you.. Consider following
example
int Val;
GetValue(Val);

bool GetValue(out int Val)
{
Val = value;
return true;
}


12. c# how to connect crystal report?

using CrystalDecison.Shared namespace

using CrystalDecisions.Shared;(name Space
using CrystalDecisions.CrystalReports.Engine;(name space)


13.WHAT IS THE EXACT USE OF INTERFACE(DONT TELL USE FOR MULTIPLE INHERITANCE)

An interface definition specifies the 'intent' of a public
interface without forcing a base implementation. It's more
used (in favour of base or abstract classes) in cases where
the interface defines some common 'high level'
characteristics or concepts for completely different
implementations - e.g:

A 'dog' interface may be specified with common methods such
as 'scratch' and 'bark', but each type of dog's
implementation of those would be completely different.
It's still a useful design feature however as it recognises
there are similarities at the higher 'behaviour' level.

14.what are the differences between windows services and web services?

A windows service is installed on a Windows box and is very windws platform dependent. it keeps running in the back ground even if the user has logged off. a service is
typically use ful where on servers there are long running processes.

15. what are wrapper Classes?

Wrapper classes are used to encapsulate values of primitive types in objects, so that they can be passed around in the same manner.