What are the different versions of Visual Studio 2010

And what can you do with these different version of Visual Studio 2010? Maybe you are wondering which version of Visual Studio 2010 you require for your specific job?

That’s are some questions I had. Previously I worked with VS2008 PRO and TS, but now I need to see which version I need. Today I found a great post that explained exactly what versions there are and what I can do with these versions.

Also interested? check out:  VS 2010 – What’s in for everyone in Software Teams?

Entity Framework 4.0 – Part3: Complex types

These tutorials are built using Visual Studio 2010 RC and .NET 4.0. RC. This means that Entity Framework 4.0 is used. At the moment of writing this, VS2010 and .NET 4.0 are not yet released as RTM so information provided in this post could change in the future.

A complex type is a set of properties that you group together. Sometimes your code becomes more clear when you group together properties. In this part I’ll show you how you can create complex types from the designer. Before EF4.0, you could also create these complex types. The only downside was that you had to do it manually in the conceptual model.

In the previous post I created a new entity called Person. As you can see below, this Person entity contains all the classic properties.

image

Now I want to group Street, PostalCode and City together in a new complex type, Address. Then I have all the address related properties together. Procedure is as follows:

  • Hold CTRL and select the properties in the model that you want to group together
  • Click on the right mouse button and in the context menu select “Refactor into New Complex Type”

image

Now you’ll see that the model browser comes up and adds a new Complex Type. Now let’s give a more meaningful name. If you open the complex type, you’ll see the properties that we previously selected.

image image

If you look at your model, you’ll see that a ComplexProperty has been added to the list. If you look at the properties, you will see that the type of this ComplexProperty is actual the Address complex type that we just created.

I’ll rename this to Address as well, it will make it more clear.

image image

Ok now let’s see how we can use this complex type:

image

kick it on DotNetKicks.com

60% Geek

Apparently I’m 60% geek, 40% normal

Not a bad score..

60% Geek

Entity Framework 4.0 – Part2: Updating the Entity model from a database

These tutorials are built using Visual Studio 2010 RC and .NET 4.0. RC. This means that Entity Framework 4.0 is used. At the moment of writing this, VS2010 and .NET 4.0 are not yet released as RTM so information provided in this post could change in the future.

In Part1 we have created our model from a database. Now you have made some changes to the underlying database and want to update the model.  For example: you created a new table in the database and also want to create an entity for this. No worries, you don’t need to delete the model and regenerate it.

Right click in the diagram and choose “Update Model from Database…”

image

This will open the Update Wizard. This window will show all the tables in the underlying database that are not yet represented by entities in your model. Here you can select the tables where you want to generate entities for.

image

Entity Framework 4.0 – Part1: How to create a model from a database

These tutorials are built using Visual Studio 2010 RC and .NET 4.0. RC. This means that Entity Framework 4.0 is used. At the moment of writing this, VS2010 and .NET 4.0 are not yet released as RTM so information provided in this post could change in the future.

In this series of blog posts I’ll explain to you how to work with Microsoft’s ORM, Entity Framework. Version 4.0 is used during the tutorials. I didn’t really blog that much before on Entity Framework because I thought the concept and usage was not ready. Now with the new release EF, I feel much more comfortable evangelizing it. Following, I’ll explain to you how you can create an entity framework model based on an already existing database.

Let’s start by creating a new console application and add a new file to the project. When the “Add new item window” comes up, select ADO.NET Entity Data Model.

image

Now the wizard will start. This wizard will help you to build up your entity model. Here you have two options:

  1. Generate from database: Here the model will be generated based on an existing database with tables.
  2. Empty model: Before Entity Framework 4.0 this didn’t really do much. But now this has changed a lot! From here you can create your own model (using the designer) and even generate a database script (to create the database and tables). How you can start from an empty Entity Framework model will be discussed in an upcoming post.

image

So we chose to generate the model from the database. This means we have select our database and tables. The wizard now asks us to select the database.

I’m going to create a “New Connection…” because I haven’t used this database before.

image

This dialog window isn’t new. If you have worked before with databases in Visual Studio, you should already be familiar with this window. It just asks you to select a server name and a database on that server.

image

Once the database has been selected, the wizard will generate the Entity connection string. This is something like a regular database connection string. The only difference is that it contains more information on the Entity Framework model. Make sure that you check “Save entity connection string in App.Config”. This will save the connection string to an App.Config file.

image

Next we need to select the tables where we want to generate entities for. In my demo I’m only going to work with the Article table. Notice that you can also add database views or stored procedures to your entity model.
Make sure that you check the two checkboxes on this window.

Pluralisation is something new in EF4.0. If you check this box, EF4.0 will pluralize the name of you entity sets based on the Entity name. This will make querying a lot more readable in your code. Before when you had an entity that called Article, you entity set would also be called Article. Now when your entity is called Article, the entity set will be called Articles. The pluralisation mechanism in Visual Studio is actually quite smart! It doesn’t just add an ‘’s’ at the end of the entity name. For instance: Category will pluralize to Categories and Ox will even be pluralized to Oxen. How neat is that? For now the pluralisation only works correctly for the English language. No problem though, you can easily create you own pluralisation service where you can add your own words. Dan Rigsby has a nice blog post on this: Entity Framework 4.0: Pluralization

image 

Once the model is completely generated, you will see that Visual Studio has created an .edmx file (the entity model) together with its generated code behind class and an App.Config (where we stored the entity connection string).

image

If you click on the .edmx file, you will see a diagram of the model.

image

The WPF text editor in Visual Studio 2010 allows us to zoom the model in and out via the scroll wheel on the mouse. If you have a lot of entities in your model, you can easily get a good overview of the diagram. Under the scrollbar you have some different options to alter the view of the diagram.

From top to bottom

  • Zoom in on the diagram
  • Zoom the diagram to 100%
  • Zoom out on the diagram
  • Launch the thumbnail viewer: This allows you to better navigate over the complete diagram

image 

If you select an entity and click on the mapping details you will see how the table fields are mapped to the properties of the entity. If you want you can change details in the properties window. Information that was set on the table fields is also set on the entity properties. For example if you create a field in the table with a max length of 100 (varchar(100)) this will also be set in the entity property. This is not something that you will find back in the generated code behind class of the model. It’s actually stored in the conceptual model.

image

image 

Now let’s write some code to retrieve data from the database. As you can see, you only need to create a new instance of you entity model. Then you can retrieve your records by calling the entity set of you entity. See how easy this is?

class Program
    {
        static void Main(string[] args)
        {
            using (var dbentities = new DemoDBEntities())
            {
                foreach (var article in dbentities.Articles)
                {
                    Console.WriteLine(string.Format("Name: {0}",article.Name));
                    Console.WriteLine(string.Format("Description: {0}",article.Description));
                    Console.WriteLine(string.Format("Price: {0}",article.Price));
                    Console.WriteLine(string.Format("Stock: {0}",article.Stock));
                    Console.WriteLine();
                }
            }
            Console.ReadLine();
        }
    }

image

Hope this was informative!

If you have any questions or remarks, please let me know..

kick it on DotNetKicks.com

Visual Studio 2010 RC crashing?

If you have been working with Visual Studio 2010 and are experiencing some crashes, read on.

I have to be honest, I haven’t experienced any big issues with Visual Studio 2010. But I did read some posts of people that did have. It’s probably because I’m not working all the time in Visual Studio 2010. I still switch between VS2010 and VS2008.

So the issues that I have read about:

Quoted from Nicholas Allen’s blog

The first fix resolves a crash that can sometimes occur when hovering over an identifier to bring up a tooltip information display. This is a different issue than the crash when bringing up an Intellisense display with an active screen reader that was fixed a few weeks ago.

The second fix addresses an issue with the code files generated by the web forms designer not including certain kinds of web controls in the generated code.

Intellisense also caused some problems in the RC release. You can read more about this on Scott Guthrie’s blog and also on Infoworld.com

The good thing about this all is that there are patches out for these bugs. So if you have them, just go to the downloads section of Microsoft Connect. Search for your bug and download the patch.

If you experience any issues while working with Visual Studio 2010, make sure to report it on Microsoft Connect. This will help out the team a lot!

Special Visual Studio 2010 Testing presentation

I just came across a nice Visual Studio 2010 presentation, focused on testing. The special thing about this presentation is that this presentation was build using Deep Zoom technology. Every point on the presentation also contains a short video.

More information can be found on Jihad Dannawi’s blog

And of course a link to the Visual Studio 2010 Testing presentation in Deep Zoom

Outlook PST file specifications released

This is something I read some days ago and found interesting. Last year Microsoft announced that they would publically release the PST file specifications to the public. That’s the file that MS Outlook is using to backup email, calendar and contacts to. This means that you would be able to get a better understanding of the PST file structure.

Could be handy to have if you would want to interface with this file. For instance build some functionality in your own CRM application to import contacts from the Outlook PST file.

Now MS has released the specs to MSDN, so if you are looking for this documentation, you can retrieve it here

Augmented reality with Microsoft Bing maps

Wow I was amazed when I saw this video on Microsoft Bing maps.

I have to be honest, I rarely use Microsoft Bing maps. But that’s because I rarely use any maps software in general. Most of the time I know where I have to be and don’t need to look it up. But when I saw this ..I really like what they have done with product, made so many integrations, it looks very slick!

PS: Mind the person at the end in the video looking at his cell phone – Funny

More information can be found on the following link on TED.com

New in Visual Studio 2010: Multi screen development

As you will already probably have noticed, the whole UI of the IDE changed. Out with the old windows look and feel and in with the new and fancy WPF powered UI. For me they didn’t have to do it. I was kind of used to the previous look. One cool thing however is the floating windows that they have introduced together with the new UI. You can do whatever you want now when it comes to code files,designer view, panels, tools… You can let a code file, a panel,etc float all over your screen. Imagine you have 2,3 maybe even 4 monitors. Filled with all your favourite panels and code files. Aaaah the development that we could do, right?

Well, with VS2010 this becomes reality. Just right click on a code file or panel and select float. You can now do with it whatever you want. Isn’t that cool?

image

image

« Vorige paginaVolgende pagina »