Posts

Showing posts from July, 2011

Help Microsoft to improve Visual Studio performance

Visual studio is a great IDE(Integrated Development Environment) and we love it all. There are many people who are still complaining about visual studio performance. Now Microsoft Visual Studio team has release PerfWaston diagnostic tool that helps Visual Studio team to diagnose the performance problem. Also this tool will automatically report performance and other problem.

So please download the PerfWaston tool from below link.
http://visualstudiogallery.msdn.microsoft.com/fa85b17d-3df2-49b1-bee6-71527ffef441?SRC=Home

You can find more details about PerfWaston in following link.
http://blogs.msdn.com/b/visualstudio/archive/2011/05/02/perfwatson.aspx

SQL Management Studio in Visual Studio 2010

Image
Microsoft Visual Studio 2010 is a great IDE and everyday I am discovering something new about it. Today I am also going to explain new feature of Visual Studio 2010. In this post I am going to Transact SQL Editor feature in Visual Studio 2010.

Visual Studio 2010 Ultimate Edition provides this great feature. You can run you SQL Queries in visual studio 2010 itself with all intellisense and all the stuff that SQL Server provides. Let’s explore in details.
To connect the database of your SQL Server in Visual studio Go to Data->Transact SQL Editor –>New Query connection like following.



Now once you click it will open the dialog box for connection SQL server like it. If you don’t have install anything it will install SQL Server 2008 express edition with Visual Studio 2010 Ultimate Edition. The dialog appear like following.




Once you are done with the connection it will open full fledge Query editor windows with intellisesnse like following.



Also it can connect to any databases inclu…

Hello World application with ASP.NET pages and WebMatrix

Image
In this post I am going to explain how we can create fast web sites without worrying about code and other stuff. Microsoft has introduced a new web development tools called ‘WebMatrix’. It’s a free tool provided by Microsoft to create website fast.
What is WebMatrix?Web Matrix is a free tool provided by Microsoft for website development. You can develop websites lightening fast with the help of Microsoft Web Matrix. It includes IIS express(express version of IIS) and SQL Server Compact (Compact edition of SQL Server database). It also contains lots of popular web application templates like wordpress ,blogengine etc. You can also create dynamic web pages with WebMatrix. Here is the link from where you can download WebMatrix.

http://go.microsoft.com/fwlink/?LinkID=205867

What is asp.net Pages?ASP.NET pages are one of easiest way to create websites pages. You can use Razor and all other syntax to create webpages. You can write script tag to write dynamic code and you can also write HTML in…

Visual Studio 2010 styles

Image
I have been working with visual studio 2010 yesterday and I was searching some thing and same time I have found one great site for Visual Studio styles. http://studiostyl.es/ This site is cool and you can find lots of visual studio 2010 styles of your choice. Here is the screenshot of site.




You can create your own color schemes for visual studio also. I have downloaded the first one(Son of Obsidian). It will be visual studio settings file.Once you downloaded you can import like following. GoTo Tools->Import and export settings in Visual Studio 2010. Once you click this It will import and export dialog like following.




I have selected Import selected environment setting and clicked next on next screen you will have option to save your visual studio settings like following.



Clicking on next you will have options for different visual studio 2010 Style like following.



Click on browse and select your downloaded style like following.



Click on open and then you will represented to recent…

Box Selection in Visual Studio 2010

Image
Every day I am discovering something new with Visual Studio 2010 and In this post I am again going to explain you new interesting feature of Visual Studio 2010. We all required to modify the code in bulk some time and there is a new features for Visual Studio 2010 which enables to made changes in multiple line at same time. Let’s take a simple example like following.

using System; namespace Parallel { class Program { private int a=10; private int b=10; private int c=10; static void Main(string[] args) { } } }
In above code I have three private variable a,b and c and now I want to make them protected. There is two way either I do manually one by one or I can do it with box selection and modify them together. It very easy to use this feature Press ALT+ SHIFT and draw box with help of mouse on the code which you need to modify like following.





Now I want to make it protected so I started writing protected and it will modify …

Windows Azure Table Storage in detail

Image
Windows Azure table storage provides two kind of storage 1) SQL Azure and other one is 2) Table,queue,blob and other storage like drives etc. In this blog post I am going to explain Table storage in details.

What is Windows Azure Table Storage:
Windows Azure table storage is a service provided by Azure platform to store data in form relational tables in windows azure storage instead of normal RDBMS System. It is a structured storage provided by Azure platform. The table storage which you create with windows azure is Unique. An account of windows azure can have any number of table storage.

Table Storage in details:
There are three important aspects when you deal with windows azure table services. Table,Entities and Properties. Here table is similar to storing data in spread sheet or storing in table with relational databases. Entity represents particular row in the table and property represents a particular column or cell in row. There are three system properties of each entity.
P…

New Improved IntelliSense with Visual Studio 2010

Image
I have posted lot many things about Visual Studio 2010 features because its a great IDE(Integrated Development Environment).Today I am going to write about IntelliSense improvement in Visual Studio 2010. Today when I was working with Visual Studio 2008 for a old project(Nowadays I am working with Visual Studio 2010), I have found new improve IntelliSense feature in Visual Studio 2010.


Filtering:
Visual Studio 2010 IntelliSense is filtered better than Visual Studio 2008. I have created a sample application and I am writing Console.ReadLine that you can see in following image its filtering with read only.



In earlier version it was not possible.Hope you like it. Stay tuned for more.. Happy Programming..



Introduction to Windows Azure

Image
Recently I have got chance to work with SQL Azure and I loved it. So that’s why Here I am going to start series of post on Windows Azure and SQL Server Azure. In first post of this series I am going to introduce you windows azure platform. I know there are many peoples that may find this post as very beginner level but We all have started from beginner level at some point of time. So It’s better to start at beginner level and then go through step by step overview.

What is Windows Azure:
Well simplest answer in this simple language to above question is “ It’s a operating system which hosts number of services on cloud”. Microsoft has developed this platform to leverage services into the cloud. In azure world you can have application and databases running on cloud. You don’t have to worry about the infrastructure of servers and all other stuff. They will be automatically done by windows azure plate form itself. All you have need to do buy a windows azure services and then developed …

Some important attributes in EFCodeFirst

Image
In today’s post I am going to explain some of the important attributes in EFCodeFirst. Whey you do scaffolding with ASP.NET MVC this all attributes are where much important. So Let’s explore all the attributes.
Key Attribute:When you put this attribute in the class it tell that this property is part of the primary key and If you use code first when its create table based on this entity then it will be a part of primary key of table. Here is the sample example of that.
[Key] public int ArticleId { get; set; } Here article ID will act as primary key.
Foreign Key Attribute:This attribute is very useful when you deal with interrelated tables You can specify the column in entity which is foreign key for that Like following.
[ForeignKey("CategoryId")] public ICollection<Category> Categories { get; set; } In above example CategoryId is a foreign key of category table to article table.
ScaffoldColumn Attribute:When you Scaffold your application with ASP.NET MVC scaffold feature o…

Parallel for loop in C# 4.0

Image
Now days we are getting our computer equipped with more and more power even now we are getting quad core processor is also at lower price. Since we have multicore processors are now so we can take advantages of multicore processor with parallel execution in C# 4.0. There are some time consuming task for the computer for example a long for loop or similar kind of things. This kind of task can be done parallel with parallel class in C# 4.0.

Now in C# 4.0 you have the Parallel static class with the help of this you can perform task parallel very easily. In this post I am going to explain Parallel for loop. Let’s take a very simple example. First lets create a example with simple for loop. Following is code for that.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Diagnostics; namespace Parallel { class Program { static void Main(string[] args) { for (int i = 0; i <=100000; i++) …

CRUD Operation with ASP.NET MVC and EFCodeFirst Part-2

Image
In the previous post I have already explained How we can list data from database easily with the help of EFCodeFirst . In this post I am going to explain How we can complete Create,Edit,Delete and Details operations within 10 minutes. So let’s first Start with Create a new Customer.I am going use same example of customer from previous post. So we have customer controller there so Let’s first create a new view for Create via Selecting View in Create() method of Customer Controller and Clicking on Add View and dialog box will open for add view like following.



As you can see in the above template I have selected Customer Model Class for strongly typed view and Selected Scaffold template as Create once you click Add your view will be ready. Now its time to write for code in customer controller to Add Customer. So I have modified Create Method of customer controller which we have created like following.

[HttpPost] public ActionResult Create(Models.Customer customer) { try { using …

CRUD Operation with ASP.NET MVC and EFCodeFirst Part-1

Image
I have been playing with EFCodeFirst now and I found it very interesting with that you could write your application fast and easily. So I have decided to write series of blog posts for CRUD Operations using ASP.NET MVC 3 and EFCodeFirstCTP5.0 . You can very easily create CRUD within some minutes of code. So let’s start first thing is to create an ASP.NET MVC 3 application like following.



Once you click OK. It will ask for the which type of View your are going to use. I have used Razor and HTML5 Semantic like following.



Now once we have create a application Now its time to add EFCodeFirst reference via NuGet. So Go to the Library Package Manager –> Manage Nuget Package Manager. It will open up a dialog like following. Search EFCodeFirst and then it will fine EFCodeFirst package like following.



Once you click Install it will add reference to your ASP.NET MVC Application like following.



So now all the things are set Its time to code now. So first I have Create my Table which is very s…