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") );
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.
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.
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?
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
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...
is working on a reply...