Welcome to Bilal Haidar [MVP, MCT] Official Blog Sign in | Join | Help

July 2007 - Posts

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
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

AJAX 1.0 in VS 2008

Two good posts by the Web Development Tools team that you should read if you are already working on AJAX 1.0 and want to start using VS 2008: 1- Upgrading ASP.NET AJAX 1.0 Websites and Web Applications to .NET Framework 3.5 2- Using VS 2008 to target

www.Hookedonlinq.com

I would like to invite you to check this wonderful website dedicated to LINQ (XML, Objects, database, Dataset, etc ...) www.hookedonlinq.com Make sure you visit it! Regards
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

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
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

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
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

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
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

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
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Optimistic Concurrency in DLinq

Dlinq handles optimistic concurrency implicitly when exexuting SubmitChanges() method. However, you can handle the resolution of the conflict and deciding on how to solve a conflict that happened. Usually, when two users retrieve the same record, one
Posted by BilalHaidar [MVP] | 1 Comments
Filed under: ,

Direct SQL Execution in DLinq

A very nice feature I find is to be able to execute a custom SQL statement in case you find the functionalities provided by the DataContext object is limited. There are two main methods: ExecuteQuery, which has two flavors of the ExecuteQuery method 1-
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

Transactions in DLinq

There are two ways in DLinq to work with Transactions. One is preferred to another. 1. Using the TransactionScope class - Preferred One using(TransactionScope ts = new TransactionScope()) { db.SubmitChanges(); ts.Complete(); } 2. Using the BeginTransaction
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

Read-Only DataContext in DLinq

As you know every object retrieved using Linq to SQL is being tracked by the DataContext class for any changes that happen in the life time of the object in the application. However, this takes more processing and off course performance will be affected.
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Compiled Queries in dLinq

In an API I use in my applications at work, we have the notion of StoredQuery. We prepare a query against the database, store it as a StoredQuery, then execute the query. Why do we need to save the query expression? Maybe at some other time, we need to
Posted by BilalHaidar [MVP] | 1 Comments
Filed under: ,

VS 2008 Orcas Beta 2 Released

The VS 2008 Orcas Beta 2 has been released! Read more about it here: http://weblogs.asp.net/scottgu/archive/2007/07/26/vs-2008-and-net-3-5-beta-2-released.aspx Regards

Apply Method Filtering on Projection Results

Applying method filtering on the results of a DLinq query is not available. For example, suppose you want to run method named Validate on the Customer ID before returning it in the query: var result= from c in db.customers select new {CustomerName= c.Name,
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

Deferred Loading in DLinq

Suppose we have an entity class called Customer and it contains a property of type List of Order entity classes. Now we want to retrieve all the customers and their orders, how do we do this using Query Expression? var results= from c in db.Customer select
Posted by BilalHaidar [MVP] | 1 Comments
Filed under:

Object Identity in DLinq

I have found out that DLinq internally uses Object Pooling ! Usually, when you retrieve a record from a Database Table, and then retrieve it again, another version is being created for you. This doesn't hold true for C# or VB.NET objects. When you create
Posted by BilalHaidar [MVP] | 0 Comments
Filed under:

Is Deferred Execution always required and needed

In the previous post, I have explained the idea behind Deferred Execution. What if you wanted to directly execute the query expression and bind the results to a GridView or any other Data Control? In this case, Deferred Execution is not required. The
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

Deffered Execution in DLinq

I have started recently working on C# 3.0 Enhancements and LINQ project at the same time. One of the nice features of LINQ is the ability to write Query Expressions. You can think of Query Expressions as a high-level SQL Query. You write a query as follows:
Posted by BilalHaidar [MVP] | 0 Comments
Filed under: ,

Update on my artricle - ExtendedMembershipAPI

I have received a bug today from my colleague Wessam Zeidan on my article Microsoft ASP.NET 2.0 Membership API Extended that was published by Code-Magazine! "The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema

Localization in ASP.NET 2.0

A series of two important and helpful articles by Rick Strahl can be found here: Introduction to Localization in ASP.NET 2.0 Creating a Data Driven ASP.NET Localization Resource Provider and Editor Hope this helps you out, Regards

How to Document your Webservice

I am always used to use XML Documentation for my code in VS 2003/2005. Lately, I have been working with Webservices and wanted also to document my webservice methods and provide some customization for the webservice as a whole. So how does it go? First

ASP.NET Development Server

In this post I will show you how to setup the ASP.NET Development Server manually and bind it to a specific Port Number and Website without having to run it by default from the VS 2005 IDE. Open your CMD window and browse to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

ASP.NET in ORCAS

I would like to invite you to check the latest article by my MVP colleague Rick Strahel, ASP.NET Orcas: Quiet Revolution Thanks Rick! Hope you will enjoy it! Regards

Fluent Interface in C#

A nice post I passed through today: Fluent Interface . It is a very nice programming style of adding "method-action" functionalities on an object. It makes you write less code and clear one! For instance, you can build Query-Like objects in an API using

Read Large XML File into a DataSet

While preparing my lectures for the 2541- Core Data Access I noticed a very nice comments on the MSDN website which talks about loading large XML files into a DataSet. When you have a large XML file, the recommend way to load it to a DataSet is as follows:

Microsoft Health Common User Interface

For those of you who develop applications targeted in the medication field, there is a very important online resource for you which I believe is a must for you to check and use all the controls offered there in your applications. Here is part of the welcome

JSON Editor

I was reading on Joe Stagner's blog today and I was amazed by the nice JSON editor he introduced on his blog, check it out here: http://www.thomasfrank.se/json_editor.html Regards

SubSoniProject - Zero DAL Code

Check out the owesome SubsonicProject that helps you build faster yet efficient Data Access Layers for your applications, whether it is Windows App or Web App! http://www.subsonicproject.com/ Regards

SingingEels is in town

I would like to invite you to check a new website I found lately: www.singingeels.com . The website contains so many useful and important articles to check! Enjoy it! Regards