|
|
-
|
|
For example, if we have two tables Country and cities then you'll write code like:
[code]
foreach (var country in countriesEntities.Countries)
{
Console.WriteLine(country.CountryName + "\nCities:");
foreach (var city in country.Cities)
{
......
|
|
-
|
|
Often people confuse with "ref" and "out". However, these are designed for different purpose.
Ref:
In general when a variable is passed to a method, another copy of that variable will be created and passed to method. "ref" will avoid creating another ......
|
|
-
|
|
As per c# specifications, though constants are treated as static members, still you can't use "static" keyword while declaring constants. I just learned from Eric Lippert's blog about the reason behind this. While designing this, before c# team, they ha......
|
|
-
|
|
Data paging becomes easier in LINQ. With the help of Take() and Skip() methods, it is so easy to implement paging.
[code]
private IList<Employee> GetEmployees(int startingPageIndex, int pageSize)
{
using (BWDataContext context = new BWDat......
|
|
-
|
|
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......
|
|
-
|
|
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......
|
|
-
|
|
When c# initially released, only reference types are allowed to have null values. Value types should have some value. Null values are not allowed in value types. In C# 3.0, Nullable types has been introduced, which allows value types having Null values.......
|
|
-
|
|
New feature "**Code Clone Analysis**" in introduce in Visual Studio 2012
You can find clones of specific code by selecting the segment you are interested then right click on the selection to choose Find Matching Clones in Solution from the context me...
|
|
-
|
|
Today while I am working on a silverlight project in visual studio 2008, I found that "start debugging" is disabled.
I resolved this issue by setting startup project for solution. ...
|
|
-
|
|
It is simple rule, but maybe some people will find this post useful.
From MSDN: "When a virtual method is called, the actual type that executes the method is not selected until run time. When a constructor
calls a virtual method, it is possible that t...
|
|