How to access to Umbraco database from console application
Hi,
Console app which access to umbraco db.
For Umbraco 7.1.4 this works ok, but after upgrading to 7.3.7 I receive error:
Current has not been initialized on Umbraco.Core.Logging.LoggerResolver. You must initialize Current before trying to read it. at Umbraco.Core.ObjectResolution.ResolverBase`1.get_Current()
my db access was
private UmbracoDatabase Db
{
get
{
if (ApplicationContext.Current != null && ApplicationContext.Current.DatabaseContext != null)
{
return ApplicationContext.Current.DatabaseContext.Database;
}
return new UmbracoDatabase("umbracoDbDSN");
}
}
How to access to Umbraco database from console application
Hi,
Console app which access to umbraco db.
For Umbraco 7.1.4 this works ok, but after upgrading to 7.3.7 I receive error: Current has not been initialized on Umbraco.Core.Logging.LoggerResolver. You must initialize Current before trying to read it. at Umbraco.Core.ObjectResolution.ResolverBase`1.get_Current()
my db access was
How I can initialize Current?
Thanks, Mike
After creating db with following code:
I receive error when use PetaPoco:
Db.TableExist
Additional information: You must set the singleton 'Umbraco.Core.Persistence.SqlSyntax.SqlSyntaxContext' to use an sql syntax provider
is working on a reply...