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

Google Chrome Error - Ah, Snap! Something went wrong while displaying this webpage

Many users are facing following error when they try to load the new Google Chrome Browser. Due to this error they could not use Google Chrome browser on their machine. This error is coming right after they installed the Google Chrome browser. The error message says: "Ah, Snap! Something went wrong while displaying this webpage. To continue, press Reload or go to another page." Following is a screen shot of the error. Error message asks to reload the or go to another page but no matter what they do, they still see this error message. Thanks to Rupesh Bhochhibhoya for solution to this problem. As per him, this problem is most probably because of anti-virus. The solution I learn is: goto properties of browser shortcut then append --no-sandbox on target line. Like: "C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --no-sandbox then you are ready to go!! Please post in the comment if you have furt...

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 ...

My Grandparents – Grand Parents Day Essay Competition Winner

Vedic won the Grand Parents Day Essay Competition at HSCF New Age Sr. Group function. There were 27 participants in his category (Elementary School Category) and he won 1st price.Full list of winners are available at http://www.hindutempleorlando.org/new-age-group . Video of Vedic reading his essay after winning: My Grandparents – Grand Parents Day Essay Competition Winner from Laksha on Vimeo . Below is the script of his Essay: My Grandparents I have three grandparents, my “dada ji, dadi ji and nani ji”. My grandparents live in India. Sometime I go to India and stay with them. My dada ji is a homeopathic doctor. Whenever I get sick he gives me sweet medicine. I love my dada ji because my dada ji take me out for a walk and always play with me. And whenever we go for a walk my dada ji tells me stories. My grand ma takes me to temple. She even played with me and made food for me. My nani ji sing “Bhajans” everyday. She play with me and take me ...