kiran


{ City } mumbai
< Country > india
* Profession * consultant
User No # 19921
Total Questions Posted # 17
Total Answers Posted # 16

Total Answers Posted for My Questions # 51
Total Views for My Questions # 167377

Users Marked my Answers as Correct # 85
Users Marked my Answers as Wrong # 16
Questions / { kiran }
Questions Answers Category Views Company eMail

What is pre-init event in ASP.NET 2.0 page life cycle?

Fulcrum Logic,

2 ASP.NET 35413

How can you change a Master page dynamically in which event of page life cycle?

Fulcrum Logic,

2 ASP.NET 8162

What is Partial in ASP.NET 2.0?

Fulcrum Logic,

2 ASP.NET 5032

What is the difference between readonly and constant in c#

Fulcrum Logic,

2 C Sharp 6860

What are the important concepts in OOPS

Fulcrum Logic,

5 C Sharp 9532

What is the difference between protected and protected internal?

Fulcrum Logic,

5 C Sharp 11750

What is the difference between these statements obj=null and obj.dispose()

Fulcrum Logic,

4 C Sharp 10395

what is overloading & overriding

Fulcrum Logic, Synergy,

3 C Sharp 5098

What is a private constructor? where will you use it?

Fulcrum Logic,

6 C Sharp 11601

What is the difference between a Dataset and DataReader? Can dataReader hold data from multiple tables?

Fulcrum Logic, Merrill Lynch,

3 ADO.NET 8248

What is singleton design pattern

CSS, Dimdim, Fulcrum Logic, TCS, Wipro,

1 Design Patterns 9784

Which tool you will use to deploy a windows service

Fulcrum Logic,

1 Dot Net AllOther 4420

What is the difference between a session object and cache object

CitiGroup, PennyWise,

2 ASP.NET 7888

What is WITH CHECK OPTION

Karur Vysya Bank KVB,

3 SQL Server 9097

What is the use of static abstract class

Karur Vysya Bank KVB, Target,

5 C Sharp 8757


 [1]   2    Next



Answers / { kiran }

Question { Visual Soft, 5649 }

When you inherit a protected class-level variable, who is it
available to?


Answer

//When you inherit a protected class-level variable, who is
it available to?
//Answer is classes within the same namespace
namespace SameNamespace
{
class MyBaseClass
{
protected int myprotectedint;

}
class MyDerivedClass:MyBaseClass
{
public int GetProtectedMember()
{
return myprotectedint;
}
public MyDerivedClass(int myvalue)
{
myprotectedint = myvalue;
}

}

class MyTest
{
public static void Main()
{
MyDerivedClass mdc = new MyDerivedClass(12);

Console.WriteLine(mdc.GetProtectedMember());
Console.ReadKey();
}
}
}

Is This Answer Correct ?    0 Yes 0 No

Question { HCL, 13389 }

Are private class-level variables inherited?


Answer

private and protected members are inherited

Is This Answer Correct ?    4 Yes 2 No


Question { Visual Soft, 7375 }

C# provides a default constructor for me. I write a
constructor that takes a string as a parameter, but want to
keep the no parameter one. How many constructors should I write?


Answer

namespace SameNamespace
{
class MyBaseClass
{
protected internal int myprotectedinternalint;

private string myName;
public MyBaseClass(string abc)
{
myName = abc;
}
public MyBaseClass()
{

}

}
class MyDerivedClass:MyBaseClass
{
public int GetProtectedInternalMember()
{
return myprotectedinternalint;
}
public MyDerivedClass(int myvalue)
{
myprotectedinternalint = myvalue;
}

}

class MyTest
{
public static void Main()
{
MyBaseClass mbc = new MyBaseClass();
MyDerivedClass mdc = new MyDerivedClass(12);

Console.WriteLine(mdc.GetProtectedInternalMember
());
Console.ReadKey();
}
}
}

Is This Answer Correct ?    0 Yes 1 No

Question { Satyam, 10717 }

What does the keyword virtual mean in the method definition?


Answer

Even though the function in base class is declared with
virtual keyword, it is not compulsory that the derived
class must override it.
namespace TestNewOverride
{
class MyBaseClass
{
int a;
public virtual int doubleit()
{
return 2 * a;
}
public MyBaseClass()
{
a = 5;
}
}

class MyDerivedClass:MyBaseClass
{
public static void Main()
{

}
}
}

Is This Answer Correct ?    7 Yes 0 No

Question { Mind Tree, 9593 }

Can you declare the override method static while the
original method is non-static?


Answer

A static member cannot be marked as override, virtual, or
abstract

Is This Answer Correct ?    5 Yes 0 No

Question { IBM, 23399 }

Can you override private virtual methods?


Answer

No

virtual or abstract members cannot be private

Is This Answer Correct ?    11 Yes 3 No

Question { Mind Tree, 9528 }

What?s an abstract clas?


Answer

1 We must say a class as abstract if it contains at least
one abstract method
2.you cannot create instance of an abstract class.

Is This Answer Correct ?    2 Yes 0 No

Question { Mind Tree, 12814 }

When do you absolutely have to declare a class as abstract
(as opposed to free-willed educated choice or decision based
on UML diagram)?


Answer

Following are features of a abstract class :-
√ You can not create a object of abstract class
* How would you describe yourself ?
98
√ Abstract class is designed to act as a base class (to be
inherited by other classes).
Abstract class is a design concept in program development
and provides a
base upon which other classes are built.
√ Abstract classes are similar to interfaces. After
declaring an abstract class, it
cannot be instantiated on it's own, it must be inherited.
√ In VB.NET abstract classes are created
using “MustInherit” keyword.In C#
we have “Abstract” keyword.
√ Abstract classes can have implementation or pure abstract
methods which
should be implemented in the child class.

Is This Answer Correct ?    3 Yes 3 No

Question { 7139 }

What are the ADO.NET Controls?


Answer

ADO.Net controls are

1/ SqlDataSource
2/ AccessDataSource
3/ ObjectDataSource
4/ DataSetDataSource
5/ XmlDataSource
6/ SiteMapDataSource

Apart from these a new data source is added in ADO.NET 3.5
which is

7.LinqDataSource

Is This Answer Correct ?    10 Yes 0 No

Question { 17539 }

what is typed and untyped dataset


Answer

We can generate Typed Dataset based on a single table or
multiple tables which are related by using primary key and
foreign key relationships through visual stdio which
generates a xsd file. This is a strongly typed in-memory
cache of data.
Untyped dataset is one which is filled/generated using a
DataAdapter and a command object.

Is This Answer Correct ?    15 Yes 3 No

Question { DELL, 12878 }

How to call the SQL commands asynchronously in ADO.NET
version 2.0


Answer

This is the sample code which tells asynchronous access

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Configuration" %>





The Poll Approach




AutoGenerateColumns="False" Width="100%">

DataField="CompanyName">
DataField="ContactName">
DataField="orderdate"
DataFormatString="{0:d}">

DataField="requireddate"
DataFormatString="{0:d}">

DataField="shippeddate"
DataFormatString="{0:d}">







Is This Answer Correct ?    3 Yes 1 No

Question { Siebel Systems, 7566 }

What is a delegate?


Answer

Delegate is a class that can hold a reference to a method
or a function.Delegate class has
a signature and it can only reference those methods whose
signature is compliant with the
class.Delegates are type-safe functions pointers or
callbacks.
Below is a sample code which shows a example of how to
implement delegates.
Public Class FrmDelegates
Inherits System.Windows.Forms.Form
Public Delegate Sub DelegateAddString()
Private Sub FrmDelegates_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub AddString()
lstDelegates.Items.Add(“Running AddString() method”)
End Sub
Private Sub cmdDelegates_Click(ByVal sender As
System.Object,
ByVal e As System.EventArgs) Handles cmdDelegates.Click
Dim objDelegateAddString As DelegateAddString
objDelegateAddString = AddressOf AddString
objDelegateAddString.Invoke()
End Sub
End Class
In the above there is a method called “AddString()” which
adds a string to a listbox.You
can also see a delegate declared as :-
Public Delegate Sub DelegateAddString()
This delegate signature is compatible with the “AddString”
method.When i mean
compatibility that means that there return types and
passing parameter types are same.Later in command click of
the button object of the Delegate is created and the method
pointer
is received from “AddressOf ” keyword.Then by using
the “Invoke” method the method
is invoked.

Is This Answer Correct ?    1 Yes 0 No

Question { TCS, 16654 }

What is ENUM?


Answer

It’s used to define constants

Is This Answer Correct ?    0 Yes 2 No

Question { 9107 }

what are the differences b/w structure and class?


Answer

Following are the key differences between them :-
1. Structure are value types and classes are reference
types.So structures use
stack and classes use heap.
2. Structures members can not be declared as protected ,
but class members can
be.You can not do inheritance in structures.
3. Structures do not require constructors while classes
require.
4. Objects created from classes are terminated using
Garbage collector.Structures are not destroyed using GC.

Is This Answer Correct ?    14 Yes 0 No

Question { 5643 }

Y go for Interface? What is use of interface?


Answer

We will go for an interface when we want to implement a
specific behaviour.

ex:
1.My class x implements IDisposable interface to handle
cleaup operation. I have to implement that behaviour by
implementing the method interface method Dispose()
explicitly in my code.

class x:IDisposable
{}
2.My class y implements IComparable interface to implement
sorting between a list of objects created of type y. Here I
have to implement CompareTo method.

Is This Answer Correct ?    3 Yes 1 No

 [1]   2    Next