<?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
<channel>
	<title>Interview</title>
	<link>http://interview.msdotnetheaven.com</link>
	<description>Best place for interview preparation</description>
	<lastBuildDate>Thu, 29 Apr 2010 15:07:55 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	<!-- generator="WordPress/3.0" -->

	<item>
		<title>Is it possible to create constructor for an Abstract class?</title>
		<description><![CDATA[Yes, its possible to create constructors for Abstract classes.  We can create Private, Public and Protected constructors for Abstract classes
Example:
Abstract class  myAbstClass
{
public  myAbstClass()
{          }
private myAbstClass(int x)
{       //some implementation      }
protected myAbstClass(string strX, string strY, int x)
{    //some implementation }
}
 Tweet This PostReaders who viewed this page, also viewed:How can I create a Singleton class by using public constructor?Powered by Where did they go from here?

Related posts:How ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-create-a-singleton-class-by-using-public-constructor.html' rel='bookmark' title='Permanent Link: How can I create a Singleton class by using public constructor?'>How can I create a Singleton class by using public constructor?</a></li>
<li><a href='http://interview.msdotnetheaven.com/oops-questions-and-answers/what-is-differance-between-abstract-and-interface.html' rel='bookmark' title='Permanent Link: What is differance between Abstract and Interface'>What is differance between Abstract and Interface</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/csharp-interview-questions/how-do-you-inherit-from-a-class-in-c.html' rel='bookmark' title='Permanent Link: How do you inherit from a class in c#?'>How do you inherit from a class in c#?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/general-interview-stuffs/is-it-possible-to-create-constructor-for-an-abstract-class.html</link>
			</item>
	<item>
		<title>Write query to get custom results</title>
		<description><![CDATA[This question is asked in recent interview, following is the scenario:
Q. I have a following table :



University
UtoTal
Status
StatusCnt


U1
100
Pending
20


U1
100
Active
20


U1
100
Deferred
60


U2
60
Pending
20


U2
60
Active
20


U2
60
Deferred
20



I want results as :



University
UtoTal
Status
StatusCnt


U1
100
Pending
20




Active
20




Deferred
60


U2
60
Pending
20




Active
20




Deferred
20



Ans: At the time of interview I wasn&#8217;t easy with the answer but I wrote a query, but interviewer not satisfied.
I got the following proper query/solution from one of my colleagues Mr. sandeep Walia:
declare @tbl table(university varchar(100),Utotals int, status varchar(100),statuscnt int)
insert into @tbl(university,Utotals,status,statuscnt)
select &#8216;u1&#8242;,100,&#8217;pending&#8217;,20
union all
select &#8216;u1&#8242;,100,&#8217;Active&#8217;,20
union all
select &#8216;u1&#8242;,100,&#8217;Deferred&#8217;,60
union all
select &#8216;u2&#8242;,60,&#8217;pending&#8217;,20
union all
select &#8216;u2&#8242;,60,&#8217;Active&#8217;,20
union all
select &#8216;u2&#8242;,60,&#8217;Deferred&#8217;,20
select * from @tbl;
with cte as (
SELECT ROW_NUMBER() OVER(PARTITION BY university ORDER BY university DESC) AS RowID,
*
FROM ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/database-question-answer/create-dynamic-query-with-dynamic-joins.html' rel='bookmark' title='Permanent Link: Create dynamic query with dynamic joins'>Create dynamic query with dynamic joins</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-db2-question-answer/i-need-to-view-the-number-of-tables-existing-under-one-particular-owner-is-it-possible-if-so-pl-give-the-sql-query-for-this.html' rel='bookmark' title='Permanent Link: I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?'>I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/mssql-question-answer/change-date-format-mmddyy-to-ddmmyy-using-query.html' rel='bookmark' title='Permanent Link: Change date format mm/dd/yy to dd/mm/yy using query?'>Change date format mm/dd/yy to dd/mm/yy using query?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/database-question-answer/write-query-to-get-custom-results.html</link>
			</item>
	<item>
		<title>Create dynamic query with dynamic joins</title>
		<description><![CDATA[Q. Here is the scenario:

declare @tt table(col1 varchar(10), joinexp varchar(100))
insert into @tt
select &#8216;c1&#8242;,&#8217;join table2 on table1.id = table1.id&#8217;
union all
select &#8216;c2&#8242;,&#8217;join table3 on table2.id = table1.id&#8217;
union all
select &#8216;c3&#8242;,&#8217;join table4 on table3.id = table1.id&#8217;
union all
select &#8216;c4&#8242;,&#8217;join table5 on table5.id = table1.id&#8217;
union all
select &#8216;c5&#8242;,NULL
union all
select &#8216;c6&#8242;,NULL
declare @str varchar(1000)
set @str = &#8216;Select c1,c4,c5,c8,c9 from table1&#8242;
declare @tt table(col1 varchar(10), joinexp varchar(100))insert into @ttselect &#8216;c1&#8242;,&#8217;join table2 on table1.id = table1.id&#8217;union allselect &#8216;c2&#8242;,&#8217;join table3 on table2.id = table1.id&#8217;union allselect &#8216;c3&#8242;,&#8217;join table4 on table3.id = table1.id&#8217;union allselect &#8216;c4&#8242;,&#8217;join table5 on table5.id = table1.id&#8217;union allselect &#8216;c5&#8242;,NULLunion allselect &#8216;c6&#8242;,NULL
declare @str ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/database-question-answer/write-query-to-get-custom-results.html' rel='bookmark' title='Permanent Link: Write query to get custom results'>Write query to get custom results</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-db2-question-answer/what-is-the-syntax-required-for-the-creation-of-a-cursor.html' rel='bookmark' title='Permanent Link: What is the syntax required for the creation of a cursor?'>What is the syntax required for the creation of a cursor?</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/mssql-question-answer/change-date-format-mmddyy-to-ddmmyy-using-query.html' rel='bookmark' title='Permanent Link: Change date format mm/dd/yy to dd/mm/yy using query?'>Change date format mm/dd/yy to dd/mm/yy using query?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/database-question-answer/create-dynamic-query-with-dynamic-joins.html</link>
			</item>
	<item>
		<title>Can I inherit two difference classes to partial classes?</title>
		<description><![CDATA[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&#8217;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, ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/can-we-store-filtered-dataview-in-viewstate.html' rel='bookmark' title='Permanent Link: Can we store filtered DataView in ViewState?'>Can we store filtered DataView in ViewState?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/csharp-interview-questions/when-you-inherit-a-protected-class-level-variablewho-is-it-available-to.html' rel='bookmark' title='Permanent Link: When you inherit a protected-class-level variable,who is it available to?'>When you inherit a protected-class-level variable,who is it available to?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/csharp-interview-questions/how-do-you-inherit-from-a-class-in-c.html' rel='bookmark' title='Permanent Link: How do you inherit from a class in c#?'>How do you inherit from a class in c#?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/asp-net-interview-questions/can-i-inherit-two-difference-classes-to-partial-classes.html</link>
			</item>
	<item>
		<title>Can we store filtered DataView in ViewState?</title>
		<description><![CDATA[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 &#8216;yes, we can store DataView in ViewState for serialized class.
 Tweet This PostReaders who viewed this page, also ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/asp-net-interview-questions/can-i-inherit-two-difference-classes-to-partial-classes.html' rel='bookmark' title='Permanent Link: Can I inherit two difference classes to partial classes?'>Can I inherit two difference classes to partial classes?</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-db2-question-answer/what-is-a-declarations-generator-dclgen.html' rel='bookmark' title='Permanent Link: What is a Declarations Generator (DCLGEN)?'>What is a Declarations Generator (DCLGEN)?</a></li>
<li><a href='http://interview.msdotnetheaven.com/oops-questions-and-answers/what-is-differance-between-abstract-and-interface.html' rel='bookmark' title='Permanent Link: What is differance between Abstract and Interface'>What is differance between Abstract and Interface</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/can-we-store-filtered-dataview-in-viewstate.html</link>
			</item>
	<item>
		<title>How can I get the date of Last Monday of specified week?</title>
		<description><![CDATA[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=&#8217;1/1/2010&#8242; &#8211;Want to know January&#8217;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 PostReaders who viewed this page, also viewed:Create dynamic query with dynamic joinsChange date format mm/dd/yy to dd/mm/yy using query?Powered by Where did they go from here?

Related posts:Change date format mm/dd/yy to dd/mm/yy using query?
Create dynamic query with dynamic joins
Interview Questions DB2 : Part &#8211; II



Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/database-question-answer/mssql-question-answer/change-date-format-mmddyy-to-ddmmyy-using-query.html' rel='bookmark' title='Permanent Link: Change date format mm/dd/yy to dd/mm/yy using query?'>Change date format mm/dd/yy to dd/mm/yy using query?</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/create-dynamic-query-with-dynamic-joins.html' rel='bookmark' title='Permanent Link: Create dynamic query with dynamic joins'>Create dynamic query with dynamic joins</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/interview-questions-db2-part-ii.html' rel='bookmark' title='Permanent Link: Interview Questions DB2 : Part &#8211; II'>Interview Questions DB2 : Part &#8211; II</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/database-question-answer/how-can-i-get-the-date-of-last-monday-of-specified-week.html</link>
			</item>
	<item>
		<title>How can I create a Singleton class by using public constructor?</title>
		<description><![CDATA[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 PostReaders who viewed this page, also viewed:What is a Lambda ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/general-interview-stuffs/is-it-possible-to-create-constructor-for-an-abstract-class.html' rel='bookmark' title='Permanent Link: Is it possible to create constructor for an Abstract class?'>Is it possible to create constructor for an Abstract class?</a></li>
<li><a href='http://interview.msdotnetheaven.com/crystal-report/difference-between-clone-close-and-dispose-methods-of-crystal-report.html' rel='bookmark' title='Permanent Link: Difference between Clone, Close and Dispose methods of Crystal Report?'>Difference between Clone, Close and Dispose methods of Crystal Report?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/define-lambda-expressions.html' rel='bookmark' title='Permanent Link: Define Lambda expressions'>Define Lambda expressions</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-create-a-singleton-class-by-using-public-constructor.html</link>
			</item>
	<item>
		<title>Define Lambda expressions</title>
		<description><![CDATA[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 &#8216;goes to&#8217; 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);
        ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/what-is-a-lambda-expression.html' rel='bookmark' title='Permanent Link: What is a Lambda expression?'>What is a Lambda expression?</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-jcl-question-answer/what-is-the-meaning-of-data-definition-name-ddname-and-dataset-name-dsname-in-the-dd-statement.html' rel='bookmark' title='Permanent Link: What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?'>What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/define-lambda-expressions.html</link>
			</item>
	<item>
		<title>How can I insert hyperlinks in ListBox?</title>
		<description><![CDATA[Its can&#8217;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 PostReaders who viewed this page, also viewed:Describe the DD statement, its meaning, syntax and keywords?What is cross page posting?What does the INITIALIZE verb do?  &#8211; GSPowered by Where did they go from here?

Related posts:What is cross page posting?
Describe the DD statement, its meaning, syntax and keywords?
What does the keyword DCB mean and what are some of the keywords associated ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/what-is-cross-page-posting.html' rel='bookmark' title='Permanent Link: What is cross page posting?'>What is cross page posting?</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-jcl-question-answer/describe-the-dd-statement-its-meaning-syntax-and-keywords.html' rel='bookmark' title='Permanent Link: Describe the DD statement, its meaning, syntax and keywords?'>Describe the DD statement, its meaning, syntax and keywords?</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-jcl-question-answer/what-does-the-keyword-dcb-mean-and-what-are-some-of-the-keywords-associated-with-it.html' rel='bookmark' title='Permanent Link: What does the keyword DCB mean and what are some of the keywords associated with it?'>What does the keyword DCB mean and what are some of the keywords associated with it?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-insert-hyperlinks-in-listbox.html</link>
			</item>
	<item>
		<title>What is a Lambda expression?</title>
		<description><![CDATA[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 =&#62; and read as &#8216;goes to&#8217; 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 = ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/define-lambda-expressions.html' rel='bookmark' title='Permanent Link: Define Lambda expressions'>Define Lambda expressions</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-jcl-question-answer/what-is-the-meaning-of-data-definition-name-ddname-and-dataset-name-dsname-in-the-dd-statement.html' rel='bookmark' title='Permanent Link: What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?'>What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-create-a-singleton-class-by-using-public-constructor.html' rel='bookmark' title='Permanent Link: How can I create a Singleton class by using public constructor?'>How can I create a Singleton class by using public constructor?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/what-is-a-lambda-expression.html</link>
			</item>
</channel>
</rss>
