locked
Using DataSets alongside Linq to SQL Classes RRS feed

  • Question

  • User-1155992655 posted

    I am updating a project I wrote some time ago.  At the time my preference was for DataSets and DataSetTableAdapters, but I've now moved on to use Linq to SQL DataClasses.  I would like to convert the project to Linq to SQL, but I am tight on time and it's a big job.  My question is, is there any reasons I can't develop new modules using Linq to SQL DataClasses along side DataSets and convert the DataSets overtime?

    Apart from the obvious confusion it will cause, are there any technical problems I should be aware of i.e. will there be any performance problems using the two methods?

    Thanks in advance.






    Monday, February 22, 2010 6:30 AM

Answers

  • User-952121411 posted

    The (2) will work independently of each other and I actually I believe the performance will improve slightly as you slowly convert over to DataContextClasses because of their lightweight nature as compared to an ADO.NET DataSet.  However, unless you had some issue with performance in the current application using DataSets the improvement might not show itself much at all if already running well. 

    As far as running along side each other, it is analogous to asking if Arrays and Collections can be used together; sure they can.  The only caveat I see in your case might be slight confusion when looking at the (2) different methodologies in code, but over time as it all gets converted it will work itself out.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 2, 2010 9:30 AM

All replies

  • User-952121411 posted

    Yes. Check out the following:

    LINQ to DataSet Examples:<!---->

    http://msdn.microsoft.com/en-us/library/bb399401.aspx 

    Monday, February 22, 2010 5:16 PM
  • User-1155992655 posted

    Thanks, but that's not really what I meant...

    I meant to say:  Can I keep my exitsing DataSets, and create new DataContextClasses for the new development work, and run them alongside each other...I know it's possible, I just want to know if there is going to a big performance hit.

    Thanks again.



    Tuesday, March 2, 2010 2:42 AM
  • User-952121411 posted

    The (2) will work independently of each other and I actually I believe the performance will improve slightly as you slowly convert over to DataContextClasses because of their lightweight nature as compared to an ADO.NET DataSet.  However, unless you had some issue with performance in the current application using DataSets the improvement might not show itself much at all if already running well. 

    As far as running along side each other, it is analogous to asking if Arrays and Collections can be used together; sure they can.  The only caveat I see in your case might be slight confusion when looking at the (2) different methodologies in code, but over time as it all gets converted it will work itself out.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 2, 2010 9:30 AM
  • User-1155992655 posted

    That's exactly what I wanted to hear ;)


    Tuesday, March 2, 2010 9:36 AM