Bilal Haidar [MVP, MCT] Official Blog

Microsoft MVP ASP/ASP.NET, MCP, MCTS, MCPD, MCT
Welcome to Bilal Haidar [MVP, MCT] Official Blog Sign in | Join | Help
in Search

Browse by Tags

All Tags » C# 3.0
  • 101 LINQ Samples

    Here is a very interesting link on LINQ! http://msdn2.microsoft.com/en-us/vcsharp/aa336746.aspx   Regards
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on January 17, 2008
  • Extension Methods in C# 3.0 and ASP.NET Code-Inline

    I was customizing a ListView today to show a small key gif beside each article listed to indicate that the article requires a login to be viewed based on whether the user is authenticated or not. So I decided to use inline checking to see if the current user is logged in or not and accordingly show/hide the Image. The code is like ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on August 13, 2007
  • Extend System.Web.HttpResponse with a WriteLine method

    While working with Console applications, you always use Console.WriteLine. I always got bothered why the HttpResponse has only Write or WriteFile. Why can't we have WriteLine? Many times you need to print something on a web page and also print a break line, and you always had to append a ''<br>''. Now, with the Extension Methods that ship ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on August 7, 2007
  • LEFT OUTER JOIN in LINQ To SQL

    I was practicing a little bit on using Linq to Sql, and had this scenario: Customers and Orders tables in Northwind Database. I added a new customer with no records, I wanted to apply a left outer join to get customers whose CustomerID starts with letter B such that, even if the Customer had no record in the Orders table, I wanted his/record to ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on August 1, 2007
  • Automatic Proeprties

    In every 3-tier application we develop, there is always a need for model objects, which are nothing but classes we use to pass between DataAccess, Business, and UI layers. These classes contain only simple properties that represent the columns of a Data Table that are retrieved from the database. As you can see, those objects need not any ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on August 1, 2007
  • Implicitly Typed Local Variables

    Implicitly Typed Local Variables is a general prupose way of declaring variables without the need to specify the data type. The data type will be infered implicitly from the initializer data. It is strongly typed variable that cannot take as input a data type other than the one used on initialization time. This proves that ''var'' is not the same ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on July 29, 2007
  • Extension Methods

    Extension methods are a way to extend the functionality of existing types by defining methods that can be invoked either by using the normal instance method syntax or in a static way. They are defined in a static class, and each extension method should be a static one. The first parameter for the extension method should be preceeded by ''this'', ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on July 29, 2007
  • Anonymous Types

    Anonymous types is a new feature of C# 3.0. It allows developers to creat local objects without the need to have a real signature of a class. This is helpful sometimes, when you have methods that take as input a large number of input parameters. What you can do is simply create a new anonymous type and use it through out the local body of the ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on July 29, 2007
  • Lambda Expressions

     1. Lambda Expressions have been introduced as an improvement to the anonymous methods in C# 2.0 as a way to make them more compact.  2. Lambda expression consists of:  . Parameter List  . =>  . Expression  3. Parameters of Lambda Expression can be implicitly or ...
    Posted to Bilal Haidar [MVP, MCT] (Weblog) by BilalHaidar [MVP] on July 29, 2007
Powered by Community Server (Personal Edition), by Telligent Systems