I was about to write this entry in my blog which I found. Before that I got comment in my previous Blog on C# 3.0 Features: Automatic Property (Part 2). The same question came in my mind. What will happen if you try to create an automatic property just with get. The C# 3.0 compiler throws an error. If you try to write

//Automatic Property

publicint CustID2

{

get;

}

The error looks like

'ConsoleApplication1.Customer.CustID2.get' must declare a body because it is not marked abstract or extern. Automatically implemented properties must define both get and set accessors.

To many it is very unfortunate because most often we may need to declare read-only property (commonly known as “getter” property). But we do have way to do this

Thank you everyone for showing interest on my blog entry C# 3.0 Features: Automatic Property. Questions like, why this approach? What if there is any condition in property? Let me tell you, we have implemented the higher level of abstraction in C# 3.0. If you are simply creating a property (we often do) then the pain declaring the local variable and its value setting/getting are being taken care by the CLR. So internally CLR declares the property exactly like what we used to do earlier.

Let’s say

publicclassCustomer

{

public Customer() { }

//Conventional Way

privateint _XYZ;

publicint CustID2

{

get { return _XYZ; }

set { _XYZ = value; }

}

//Automatic Property

publicint CustID

{

get;

set;

}

}

For both the cases if you examine the assembly through IL DASM. You will get the following result (the red-boxed areas are for automatic property)

If you have noticed for the property CustID (which is Automatic) it created a private variable k__AutomaticallyGeneratedPropertyField0 of type int32. This is the extra work CLR does for us.

We do have backward compatibility with C# 3.0. That means all the code that you have written in previous version of C# will compile with no error (provided it is clean codeJ).

I am super excited with the Orcas March 2007 CTP release. I was doing the hands on with the C# and LINQ and as you know C# 3.0 comes with a lot of new things which increases the level of abstraction for the developer. We now write less and do more. As I often have mentioned in my previous entries and presentations with Microsoft Partner that now have think more on why not on how. I remember the day when I first learned the Property. I used to scratch my head on what to do with get or set. I probably started it now as we have snippet for property. Anyways in conventional way we declare property in a class like

publicclassCustomer

{

public Customer() { }

privateint _CustID;

publicint CustID

{

get { return _CustID; }

set { _CustID = value; }

}

}

Now C# 3.0 suggests us not to invest so much. Rather than using property like

privateint _CustID;

publicint CustID

{

get { return _CustID; }

set { _CustID = value; }

}

We can declare property like

publicint CustID

{

get;

set;

}

No more private variable or = or value etc required. This is Automatic property in C# 3.0.

LINQ to SQL (aka DLinq) generates SQL queries for us at the back. SqlMetal.exe does not contain any SQL query as it is pure object we do not prefer to keep anything which is not strongly typed. As you all know that LINQ to SQL creates the query for us. But the question is how it looks like? If you really want to verify the performance to make sure that LINQ to SQL is giving us the best query performance (always pain to DB developer)

Very well it will return the values one by one. Then how is the query?

Yes we do have a property to get the SQL query inside the SqlMetal.exe generated class file. The name of the property is Log. Let’s see how we can implement it. I am using Console application. The code will look like

db.Log = Console.Out;

This will give you the SQL query in output window and the query would look like,

Few days back I have talked about the IE 7 short cut keys in one of my BLOG entries at IE 7 Shortcut keys tips. I also have found a page at IE 7 in Microsoft which talks about the exhaustive list on the same. Let me share that with you here

i’m is a new initiative from Windows Live™ Messenger. Every time you start a conversation using i’m, Microsoft shares a portion of the program's advertising revenue with some of the world's most effective organizations dedicated to social causes. We've set no cap on the amount we'll donate to each organization. The sky's the limit.

So any time you have an i’m™ conversation using Windows Live Messenger, you help address the issues you feel most passionate about, including poverty, child protection, disease, and environmental degradation. It's simple. All you have to do is join and start an instant messaging conversation. We'll handle the donation.

We have released the VPC of Orcas March 2007 CTP to avoid the conflict in production machine. Since the Virtual PC 2004 SP1 is free and now downloadable from MSDN. One very important thing is that you should not miss to download the Orcas Base Image. If you miss to download this you will end up loosing the valuable experience with the magic of Orcas.

In this video you will learn how to use the TextBoxWatermark control extender from the ASP.NET AJAX Control Toolkit, which adds new watermark properties to all standard TextBox controls on an ASP.NET...

BLinq is Linq integration to ASP.NET Applications which is now available in official ASP.NET website at http://www.asp.net/sandbox/app_blinq.aspx?tabid=62. You can download and install the exe to work with BLinq. BLinq is named keeping in mind that the web world is captured by blog sites and Linq is the core mapping technology behind it.

Before downloading you can check the prerequisites to enjoy the feature. The forum queries and feedback are being addressed by Polita Paulus who created this tool. So you can expect positive response from the forum. Before starting you can watch the 17 minute video from http://www.asp.net/learn/videos/view.aspx?tabid=63&id=35. This is a really interesting video by the creator of BLinq.

Lot more other switches are available. This will create a virtual directory with the name MyBlinqVD from the existing folder at c:\MyBlinqD from the Northwind database at myServer’smyInstance using the user credential dbCracker\secret!

Let’s explore more and give feedback to developer directly.

[I am dedicating this article to one of my friends new born baby “Sricharan”]

If you have installed Orcas March 2007 CTP and trying to play with SQL Server 2005 Express database using the IDE feature. You might meet with an error mentioning “Unable to find the requested .Net Framework Data Provider.It may not be installed.” while trying the below mentioned steps

In Server Explorer, Add New Connection - > Choose SQL Server 2 - > Provide the local database server information -> (drop down will not be refreshed or if you forcefully type the database name in the text box) and hit OK button. The above mentioned error will block you to go ahead.

I did install Orcas in fresh machine and then installed VS 2005 there. I think that was the issue. But the workaround is little tricky here,

Steps to follow:

Go to the folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG

Select the Machine.config and then find the tag <DbProviderFactories> under <system.data>.Then next step is to hide all the provider entries which has either Version=3.5.0.0or Version=9.0.242.0.