Skip to main content

ADO .NET Entity Framework – Building First Model - Step By Step

Please note that - You will need to install Visual Studio 2008 to have Entity Framework. Visual Studio 2008 comes with Entity Framework.
Open a new or existing project and then select “Add New Item”. From the Add New Item dialog box select “ADO.NET Entity Data Model” option. Name the entity model file and click Add.
image
VS will ask and suggest to store this new file in App_Code folder. Say yes.

image
This will start the Entity Data Model wizard. Select the Generate from database option and click next.
image
image
image
image
image
image
Note the name of the Model Namespace - Laksha.DnnInternet.EntityModel. You should always name your namespaces, solutions, projects starting with few letters form your company name or acronym. For example Microsoft always use Microsoft or System in all their namespaces.
Click Finish. This will generate two files LakshaEntityModel.edmx & LakshaEntityModel.Designer.cs.
image
Double click the LakshaEntityModel.edmx file to open it in the EDM Designer.
image
In the next step I will go over the generated code, entity model and different windows in the Visual Studio.




Comments

Post a Comment

Popular posts from this blog

SharePoint WebPart Error - Unable to add selected web part (s) – MOSS 2007

ISSUE: Recently I faced this issue that when I try to deploy my WebPart.  Unable to add selected web part(s). WebPartName: Cannon unregister UpdatePanel with ID ‘ctl00RTMPanel’ since it was not registerd with the ScripManager. This might occure if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel.   I faced this issue twice and both the time the issue was not what display here. This could be sure to any error in the WebPart. Following are list resolution from multiple instances.   RESOLUTION: 1. Check the WebPartName.webpart file. Check whether you have a proper PublicKeyToken value. When I face the issue the value was PublicKeyToken=$PublicKeyToken$. If you have used WSP builder then in the Visual Studio you will find this file at \WebPartsProject\12\TEMPLATE\FEATURES\WebPartName\WebPartName.webpart. Sometime when you create a new WebPart using WSP builder then you do not get

TIME – 25 Best Blogs of 2009

Every year Time makes a list of best blogs in the world. They chose 25 blogs from millions of blogs in the world, spanning politics, housekeeping, astronomy and everything in between. Below if a direct link to the TIME website for the list. I also copied it to easy comparison of last year best with this year best blogs.   25 Best Blogs of 2009     25 Best Blogs 2008   25 Best Blogs of 2009 Talking Points Memo The Huffington Post Lifehacker Metafilter The Daily Dish by Andrew Sullivan Freakonomics BoingBoing Got2BeGreen Zen Habits The Conscience of a Liberal: Paul Krugman Crooks and Liars Generación Y Mashable Slashfood Official Google Blog synthesis bleat /Film Seth Godin's Blog Deadspin: Spor

How to Fix WordPress Site Address (URL)

If you are caught in middle between changing your WordPress website/blog URL - Site Address (URL) setting in the WordPress then there is a simple solution available to override WordPress Site Address (URL) values that is saved in database. You need access to the wp-config.php file which can be found in the root of your WordPress install. Make sure you make a back up copy of this file before you open it. If you are using shared hosting, then please use control panel provided by hosting company or use FTP application such as FileZilla. Open the wp-config.php file and add following lines to this config file where the “http://example.com/” is the URL you want to access. define( 'WP_SITEURL', 'http://example.com/' ); define( 'WP_HOME', 'http://example.com/' ); This should solve your issue with WordPress Site Address URL. If this post helped you then please let me know.