none
DataSet or Entity Framework RRS feed

  • Question

  • Hi,

    I am newbie to Ado.Net framework and my question is very general and fundamental.  I am developing stand alone application in WPF using MVVM pattern in VS 2012.  The application will have some views which will bind to data sources plus it will allow to create new records in tables.  

    I connected to database, then tried to create a Data Source with the wizard.  But then I was asked to select either Entity Framework or DataSet.  Can anyone suggest please what do I need to select for my needs.  Based on this I will then read and learn the material and follow some example codes.

    Thank you


    Wednesday, May 29, 2013 6:49 PM

Answers

  • Hi Alex;

    I prefer working with Entity Framework over DataSet one of the main reason is that DataSet is a heavyweight object and more cumbersome to work with in comparison to Entity Framework. The other reason is that Entity Framework is a newer technology with a lot more bang for the buck.

    Please see this web site for information on Entity Framework. Get Started with Entity Framework (EF)

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Alex Teslin Wednesday, May 29, 2013 9:01 PM
    Wednesday, May 29, 2013 8:29 PM
  •   

    Can you zip the WPF project up with the database file you are trying to open with EF that you are having problems with to your SkyDrive in a public folder and post the link here and I will have a look at it.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Alex Teslin Thursday, June 13, 2013 4:32 PM
    Thursday, June 13, 2013 2:12 PM

All replies

  • Hi Alex;

    I prefer working with Entity Framework over DataSet one of the main reason is that DataSet is a heavyweight object and more cumbersome to work with in comparison to Entity Framework. The other reason is that Entity Framework is a newer technology with a lot more bang for the buck.

    Please see this web site for information on Entity Framework. Get Started with Entity Framework (EF)

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Alex Teslin Wednesday, May 29, 2013 9:01 PM
    Wednesday, May 29, 2013 8:29 PM
  • Thank you Fernando.  I thought to use EF but wasn't sure and thought an expert's suggestion would provide reasons why.

    I've checked the link you've provided and looks very good, lot of material with even video contents.  I wish there was a designated place for learning WPF with MVVM.

    Thanks again

    • Marked as answer by Alex Teslin Wednesday, May 29, 2013 9:00 PM
    • Unmarked as answer by Alex Teslin Wednesday, May 29, 2013 9:01 PM
    Wednesday, May 29, 2013 9:00 PM
  •   

    Not a problem Alex, glad to be of help.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, May 29, 2013 10:09 PM
  • Sorry for coming back to this but I am experiencing the ongoing problems.  I have reinstalled my VS 2012, this time professional trial version instead of Express 2012.

    I have added EntityFramework v5 to my Project through Nugget.  When trying to create a New Data Source in Data Sources explorer the only option I have is Dataset, but previously I could choose either Dataset or Entity Framework.  Or when right-clicking the project -> New Item -> Data, I can not see ADO.Net Entity Data Model.  

    I don't understand I am doing everything the same as I did on Express version following the Entity Framework link:

    http://msdn.microsoft.com/en-us/data/jj206878

    Thanks again

    Wednesday, June 12, 2013 3:52 PM
  • This is strange.  I just did the same in VS2010 trial version and it worked.  I have choice of DataSet and Entity Data Model when adding New Data Source.

    It must be then some sort of bug in VS2012 Professional trial version. 

    It seems to me that there are quite a few bugs around as for the second week I didn't go far (can not even open some Prism examples)

    Wednesday, June 12, 2013 4:21 PM
  • Hi Alex;

    Before you can find a data source in the Data Sources explorer you need to have created the EF model by right-clicking the project -> New Item -> Data. But you say you can't find it there.

    What type of application are you building?

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, June 13, 2013 1:58 AM
  • This is what I have been doing.  I am creating WPF application.  I initially installed VS 2012 Express to do that.  I installed EF package through Nuget and it worked.  Because I never done this sort of application before, I went for search for samples online. I came across the Prism structure and pattern so I downloaded the Prism to run their examples.  But unfortunately I couldn't run them on VS 2012 and Framework 4.5.

    So then I removed VS 2012 Express, installed VS 2010 Professional Trial, then installed VS 2012 Professional trial to work together with VS 2012 - side-by-side, so that I can open examples in VS 2010 and create my WPF application in VS 2012.  I went to install EF again with Nuget in VS 2012 and found there was an Update 2 for VS 2012, so I went ahead to update my VS 2012.  I don't know if this have caused the problem. 

    I tried several new WPF application projects, installed EF package, but when I go to the right-click the project -> New Item -> Data, I can not find EF option, only Dataset.  For some reason it works in VS 2010, but I really want to work in VS 2012.

    Thank you for support 

     
    Thursday, June 13, 2013 8:18 AM
  •   

    Can you zip the WPF project up with the database file you are trying to open with EF that you are having problems with to your SkyDrive in a public folder and post the link here and I will have a look at it.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Alex Teslin Thursday, June 13, 2013 4:32 PM
    Thursday, June 13, 2013 2:12 PM
  • On 5/29/2013 2:49 PM, Alex Teslin wrote:

    Hi,

    I am newbie to Ado.Net framework and my question is very general and fundamental.  I am developing stand alone application in WPF using MVVM pattern in VS 2012.  The application will have some views which will bind to data sources plus it will allow to create new records in tables.

    I connected to database, then tried to create a Data Source with the wizard.  But then I was asked to select either Entity Framework or DataSet.  Can anyone suggest please what do I need to select for my needs.  Based on this I will then read and learn the material and follow some example codes.

    Thank you

    What is an ORM. EF is an ORM solution.

    http://en.wikipedia.org/wiki/Object-relational_mapping

    When using EF, it leads to learning this.

    <http://en.wikipedia.org/wiki/Object-oriented_programming>

    And in turn it leads to learning this.

    http://www.dofactory.com/Patterns/Patterns.aspx

    Tutorial in VB...
    <http://www.vbforums.com/showthread.php?540421-Tutorial-An-Introduction-to-the-ADO-NET-Entity-Framework>

    <http://www.codeguru.com/csharp/csharp/net30/article.php/c15489/ADONET-Entity-Framework-Tutorial-and-Basics.htm>

    Also,welcome to the world of Linq.

    http://www.linqpad.net/

    Thursday, June 13, 2013 4:31 PM
  • Thank you so much Fernando for your support, but before I read your email I took some drastic steps:

    I reinstalled the Windows 7 on my machine and installed all the updates, then installed VS 2012.  Created new project with Entity Framework been working fine now.

    In terms of having VS 2010 and trying to open and learn some MVVM and Prism examples I decided to have on separate machine.  As it was making things complicated on top of having to learn new technology.

    Once I am comfortable I can perhaps then use side-by-side VSs.

    Thanks again for your help - much appreciated.

    Thursday, June 13, 2013 4:32 PM
  •   

    Not a problem Alex, glad to help.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, June 13, 2013 5:01 PM