Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Spyros Spyriadis 46 posts 70 karma points
    Mar 04, 2012 @ 19:37
    Spyros Spyriadis
    0

    Umbraco v5 - Sqlhelper

    Is there any way to get a connection to the database as an alternative to SqlHelper in v4? In the previous version of umbraco you could query the database using:

    var sqlHelper = umbraco.BusinessLogic.Application.SqlHelper;
    var reader = sqlHelper.ExecuteReader(
    @"SELECT * FROM custom_table WHERE columnA = @columnA  ",                         sqlHelper.CreateParameter("@columnA", "value")
    );

    Is there any way to do this on v5?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 04, 2012 @ 20:59
    Jeroen Breuer
    0

    In v5 you probably need to this through hive. There isn't an SqlHelper in v5, but it uses nHibernate to query the database, so perhaps it's possible by writing some linq queries. Might be a good idea to have a look at the source to see how it's done there.

    Jeroen

  • Spyros Spyriadis 46 posts 70 karma points
    Mar 05, 2012 @ 08:52
    Spyros Spyriadis
    0

    Any easier way to do it without having to create new classes and schemas that are required in order to declare a new table in nHibernate. I managed to do it through a new custom SqlConnection directly to the DB. 

    I'm looking for a more efficient way...

Please Sign in or register to post replies

Write your reply to:

Draft