Saturday, January 2, 2010

The operation could not be completed. Class not registered- Visual Studio 2010 Express edition beta2.

My operating system was crashed so i have again downloaded and installed Microsoft Visual Studio 2010 Express edition beat 2. But when i was trying to create a web application then i got the error message that “The operation could not be completed. Class not registered.” Other projects were working fine and I am able to create asp.net website. After doing searching for sometime the i found following link.

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=498787&wa=wsignin1.0

From that i found that it was Microsoft SQL Server Express edition that is creating problem. I had installed Microsoft Visual Studio IDE not the SQL Server Express 2008 edition. So i have installed SQL Server Express Edition 2008 and now its working fine. But it is very strange that i can not create a web application project with out installing it.

Technorati Tags: ,
Shout it
Share:

Happy New Year 2010- From the writer of DotNetJaps

Technorati Tags: ,

I wish happy new year 2010 to all my readers.I know that this blog has been quite from last 1 or 2 month but i was busy with professional end as well as my computer operation system was break so it was long process to get my all data back and having reinstalled all the software and other thing i need but i promise you that i will post all the new latest thing asp.net 4.0,Microsoft SQL Server 2008, Silver light and other latest Microsoft Technologies that I am going explore in this new year so you will going hear at least one post week from this blog.

Once again I am wishing you a very happy and phosphorus new year to all of you.

Shout it
Share:
Monday, November 30, 2009

C# 4.0-Dynamic Data Type, Difference between var and dynamic

C# 4.0 introduces a new keyword called 'Dynamic'. It can consume any object anything. Let's see some examples for that.
dynamic intExample = 1;
Response.Write(intExample);

dynamic floatExample = 2.5;
Response.Write(floatExample);

dynamic stringExample = "DotNetJaps";
Response.Write(stringExample);
It will print out put on web page as following.

C#-4.0-Dynamic-Keyword-Diffrence-Between-Var-And-Dynamic-Type

Now, you will have question what's new in that. It could be also done with var keyword . Yes, you can do same thing with var but dynamic keyword is slightly different then var keyword.

Diffrence between var and dynamic keyword:

var keyword will know the value assigned to it at compile time while dynamic keyword will resolve value assigned to it at run time. I know you guys don't believe me without example. So let's take example of string.
string s = "DotNetJaps-A Blog for asp.net,C#.net,VB.NET";
var varstring=s;
Response.Write(varstring.MethodDoesnotExist());
Now try to compile above code it will not compile and it gives a error that 'string' does not contain a definition for 'MethodDoesnotExist' and no extension method 'MethodDoesnotExist' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?'. So var keyword knows that what value or object or anything assigned to it. Now lets try to compile same code with dynamic example like following.
string s = "DotNetJaps-A Blog for asp.net,C#.net,VB.NET";
dynamic varstring=s;
Response.Write(varstring.MethodDoesnotExist());
This will compile. So it is the difference between dynamic and var keyword. With dynamic keyword anything assigned to it like property,objects operators anything that will be determined at compile time. It can be useful while we are doing programming with com,JavaScript which can have runtime properties.

Happy Programming...

Technorati Tags: ,,,
Shout it

kick it on DotNetKicks.com
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews