Forum Topic

Which is better: SQL or LINQ?

  • Do you have any idea that you want to share if which is better between SQL and LINQ?
  • they are not the same.

    SQL is used to access database, while LINQ is used to access data in .net (ADO.net).
  • i think ang ibig nya sabihin e.

    which better - manually handcraft mo yung SQL script sa DAL mo or use LINQ that will auto generate yung SQL script?


    para sakin yung manually handcrafted na SQL script pa rin. Kung i-open mo yung SQL Profiler, tapos monitor mo yung mga ni-gegenerate na sql ng LINQ meron ako nakikita na hindi optimize. Lalo na yung mga complex LINQ, hindi optimize e.

    Pag yung architect hindi ganun kagaling sa SQL, pag nagdesign ng application Entity framework ginagamit nun. Pero pag ang architect e well versed din sa SQL, asahan mo, alam mo na yun.
  • For CRUD operations, use LINQ. Very beneficial for RAD or Agile.

    For Search, Reports, Transaction use embedded SQL in DAL but if you\'ve got time use stored proc for better separation of concerns and better reusability.
  • egg-sac-li
  • mas madali din ang support pag SQL kesa LINQ, esp. sa mga reports. Tama sila, mabagal kadalasan ang reports pag LINQ ginawa, may ilan na din kami ni convert na report to SP para bumilis.
  • which better - manually handcraft mo yung SQL script sa DAL mo or use LINQ that will auto generate yung SQL script?

    i see. thanks


    For CRUD operations, use LINQ. Very beneficial for RAD or Agile.

    For Search, Reports, Transaction use embedded SQL in DAL but if you\'ve got time use stored proc for better separation of concerns and better reusability.


    i agree with this one.
  • baka he/she meant LINQ2SQL?

    saken naman if applicable, LINQ2SQL, kung di kaya sa LINQ2SQL, raw SQL.

    nakakaubos ng oras yung gagawa ka ng CRUD manually tapos minsan problema mo pa yung relationships. lahat yan given na kay LINQ2SQL.
  • nakakaubos ng oras yung gagawa ka ng CRUD manually tapos minsan problema mo pa yung relationships. lahat yan given na kay LINQ2SQL.


    code generator. isang click lang meron ka ng class para sa CRUD. pwede mo pa i-extend yung class kung meorn ka gusto idagdag na method for complex sql.
  • gumagamit lang ako ng ORM kapag nagbigay sila ng tight deadline, pero kung hindi naman, the best sa akin ang Micro-ORMs since its \"Close to Metal\"
  • @arthurjr07: sir pwede makahingi ng examples ng code generator na sinasabi nyo po?

    gumagamit lang ako ng ORM kapag nagbigay sila ng tight deadline, pero kung hindi naman, the best sa akin ang Micro-ORMs since its \"Close to Metal\"


    sir, ano example ng mga micro-ORMs?
  • codesmith yung ginamit nmin dati. kung gusto mo meron ko ginawa sarili kong DAL/Entity generator. email mo ko forward ko sayo.
  • @arthurjr07: pm sent! thanks po
  • @kimerran

    Dapper, OrmLite, Massive, PetaPoco and Simple.Data

    -- edited by Mabuting_tao on Oct 02 2013, 01:19 AM
  • Manga sir pa turo naman pano mag install ng sql server gagamitin ko sana sa mini office namin thanks