Articles in the Microsoft .Net Category
Asp.Net, CSharp, Company asked interview questions, RSystems »
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 »
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
CSharp, Microsoft .Net »
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 »
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);
…
Asp.Net, Microsoft .Net »
Its can’t possible adding hyperlinks/links to listbox.
Its just a collection items not child items and are not render while anyone put some html tags. So, its not possible
Tweet This Post
LINQ »
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);
static void Main(string[] args)
{
//assign lambda expression to a delegate:
myDel myDelegate = …
Asp.Net, HTML »
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ id=”name” width=”468″ codebase=”http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0″ height=”60″>
<param value=”http://www.msdotnetheaven.com/shubhhostingDiwali.swf” name=”movie”/>
<param value=”high” name=”quality”/>
<param value=”transparent” name=”wmode”/>
<embed
pluginspage=”http://www.macromedia.com/shockwave/download/index.cgi?
P1_Prod_Version=ShockwaveFlash” quality=”high” type=”application/x-shockwave-flash” height=”60″ src=”http://www.msdotnetheaven.com/shubhhostingDiwali.swf” width=”468″ wmode=”transparent” name=”name”>
</embed>
</object>
Tweet This Post
Asp.Net »
By default width of column handled automatically, means columns in Gridview control are sized automaticlaly internally column cells redered as HTML cell. On the basis of requirement one can set the width dynamically also.
Following are the steps to do it;
1. Setting Column Width Dynamically:
Through code, set the width property on the ItemStyle of GridView.
Following is the code-snippet for the same:
VB.NEt:
[CODE]
Dim intColWidth As Integer = 25
GridView1.Columns(0).ItemStyle.Width = intColWidth
[/CODE]
C#:
[CODE]
int intColWidth = 25;
GridView1.Columns(0).ItemStyle.Width = intColWidth;
[/CODE]
2. Setting Column width as per Data-Content :
Write following piece of code in RowDataBound handler / event:
Note: Code is …
OOPs, VB.Net Interview »
No, you can’t the signature of the virtual method must remain the same, only the keyword ‘virtual is changed to keyword override’.
Tweet This Post
CSharp, OOPs, VB.Net Interview »
In overriding, you change the method behavior for a derived class.
While, overloading simply involves having a method with the same name within the class.
Tweet This Post

