| Next Tip?

Asp.Net, Company asked interview questions, CSharp, RSystems »

[25 Jan 2010 | No Comment | 3,314 views]

Q. Can I inherit two difference classes to partial classes? Following is the whole scenario of this question:
I have two classes XYZ and ABC and two partial classes  of class myClass now is it possible:
partial class myClass : XYZ
{
}
partial class myClass : ABC
{
}
Ans:  This question I have asked in RSystems, Noida and I am sharing hereunder with you :
We can’t inherit two difference classes to partial class because in C# multiple inheritance is not possible using classes.
The main reason is in C# we cant do the following:
class myClass : XYZ, …

Asp.Net, Microsoft .Net »

[25 Jan 2010 | No Comment | 2,502 views]

The question is asked in RSystems, Noida and I am sharing the same with you, my asnwer is as follows, if anyone have idea or more depth in answer please share where:
We can store only objects of the following types:
1. string
2. integers
3. boolean
4. Array
5. ArrayList
6. Hash tables
7. Custom types etc.
Apart from above we can share some other types too but the class must be serialized.
In view of above theory, we can say ‘yes, we can store DataView in ViewState for serialized class.
Tweet This Post

Database Questions, MsSql Server »

[22 Jan 2010 | No Comment | 768 views]

The query is asked in my recent interview and the same I want to share with you. If anyone has better solution(corrected by Sandeep Walia)  please share here:
declare @dt datetime
set @dt=’1/1/2010′ –Want to know January’s Last Monday Date
SELECT dateadd(d,-datepart(dw,DATEADD(d, -datepart(d,dateadd(mm,1,@dt)),dateadd(mm,1,@dt))-1)+1,DATEADD(d, -datepart(d,dateadd(mm,1,@dt)),dateadd(mm,1,@dt)))
Tweet This Post

CSharp, Microsoft .Net »

[11 Jan 2010 | No Comment | 851 views]

I have also asked a tricky question like this:
Can we create a singleton class using public constructor?
Simply answer is yes.
Practically, many of us aware that we can create a singleton class by using private constructor an creating a property, but we can create a singleton class by using public constructor as folows:
static void Main(string[] args)
{
try
{
Singleton obj3 = new Singleton2();
Singleton obj4 = new Singleton2();
Console.Read();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.Read();
}
}
static void Main(string[] args)
{
try
{
Singleton obj3 = new Singleton2();
Singleton obj4 = new Singleton2();
Console.Read();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.Read();
}
}
Tweet This Post

LINQ »

[9 Dec 2009 | No Comment | 868 views]

A Lambda expression is nothing but an Anonymous Function, can contain expressions and statements. Lambda expressions can be used mostly to create delegates or expression tree types. Lambda expression uses lambda operator => and read as ‘goes to’ operator.
Left side of this operator specifies the input parameters and contains the expression or statement block at the right side.
Example: myExp = myExp/10;
Now, let see how we can assign the above to a delegate and create an expression tree:
delegate int myDel(int intMyNum);