LINQ vs ADO.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LukasMalik
    New Member
    • Jan 2008
    • 22

    LINQ vs ADO.NET

    Hi all,

    I am developing an win form application (C#) which uses database almost in every opperation.
    Question is, what kind of "communicat ion" with dbo would you suggest me?
    Well, approximately 1/5 of application DataLayer is already writen with ADO.NET and I dont feel discomfortable if I have to write SQL Select ( or update, or exec stored proc etc) with ADO.NET, after already writen hundreds of this it does not take more than minutes.

    Secondly, I have never used LINQ. I just wanna make sure that I didnt miss somethink very usefull and any breaking change. Better change 1/5 application Data Layer now than after months whole one......
  • balabaster
    Recognized Expert Contributor
    • Mar 2007
    • 798

    #2
    The advantage of LINQ is the ability to have hard typed access to tables/columns in your database within your code. It provides a lot of design-time functionality which is a dream and compiles down pretty much to the same code as your ADO.NET would (give or take) so it still builds an SQL query under the covers - it just provides the neat ability to reference tables, columns and data exactly as if you're coding to regular classes and methods. I personally think it's great, but I imagine there are people out there that think it's the worst invention ever. Each to their own.

    Comment

    • LukasMalik
      New Member
      • Jan 2008
      • 22

      #3
      Originally posted by balabaster
      The advantage of LINQ is the ability to have hard typed access to tables/columns in your database within your code. It provides a lot of design-time functionality which is a dream and compiles down pretty much to the same code as your ADO.NET would (give or take) so it still builds an SQL query under the covers - it just provides the neat ability to reference tables, columns and data exactly as if you're coding to regular classes and methods. I personally think it's great, but I imagine there are people out there that think it's the worst invention ever. Each to their own.
      I am not ortodox ADO.NET fanatic, I will probably start to use LINQ, but I have few questions still:

      1) other dev group works on database which dynamicaly change until first beta version of application is released. After that no. of changes will decrease (I hope so :-) )
      That means I have to still re-generate my database class using SqlMetal.exe? After every database change?
      2) I have user controls with high usage which has DataSource property (type of 'object' which is converted into DataTable or DataSet). Lets imagine - in DataLayer I get result frm SQL LINQ query - var customers. Which type is it? Will I be able to convert it into DataTable?

      Thanks a lot

      Comment

      Working...