|
|
-
|
|
In below code snippet, A and B are circularly dependent on each other. What will be the output of the program? Will it give compile time error?
[code]
partial class Test
{
public static int A = B + 5;
public static int B = A + 5;
}
cla......
|
|
-
|
|
Recently my colleague asked me this question, "Can a private class can be inherited by another class?" What do you think Yes? or No?
Question itself is invalid. There are no private classes in c#(Except nested classes). A class can be either public......
|
|
-
|
|
Use Table.Where() instead of Table.ToList.Find() when you are filtering rows and using LINQ.
–"ToList.Find()" returns all records from a table and then runs the filter in memory
–"Table.Where()" is performed in SQL and returns only the rows requeste......
|
|
-
|
|
While analyzing our c# application with fxcop, it showed us a message "Don't use c-style casting. Use UnBoxing in c#." A quick search in google reveals the below difference. With c-style casting, even if the source object is not from same as destinatio......
|
|
-
|
|
While handling multiple results in TSQL is not possible, it is easily possible in front end tools like VB6, .NET, etc. Here is an example for it. Consider rs is the recordset that retreives multiple resultsets from a stored procedure.
[code]Set rs=rs.N......
|
|
-
|
|
Just learned from Eric Lippert's blog the difference between a "reference" and a "pointer". References are aliases names for variables and Pointers hold the address of these variables.
[code]
public int Add(ref x,ref y)
{
return x + y;
}
[/c......
|
|
-
|
|
When a web page shows images, for each image it generates a separate HTTP Request to the server. Say, a web page consisting of 10 images sends 10 additional HTTP Requests for each image apart from the general web page request. This will affect performan......
|
|
-
|
|
C# 4.0 introduced the concept of optional parameters and Named arguments. While defining a method, We can define parameters as optional. While calling the method, parameters which are declared as optional, need not to be passed.
[code]
......
|
|
-
|
|
Just learned from Scott Gu's blog that VS 2010 provides more debuggin capabilities like
Run to Cursor - In general, we will keep the breakpoint very early in the code and from then we will press F10/F11 keys to reach to the actual location. Then, ......
|
|
-
|
|
Often when we perform a Check-Out operation in Team Foundation Server (TFS), the workspace version of the code gets checked out by default, which sometimes may not be the same as the server version due to various reasons like the developer himself might......
|
|