I get an error when attempting to add a user control that has a listview bound to a database(the same database that was created for the umbraco installation). It may not be best practice to put my own tables in this database but anyway...
Here is the error when loading the site:
Error creating control (usercontrols/ProductSearch.ascx). Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!
in what context is this? are you using 3rd party package? if so, what package? what umbraco version? also, try adding ?umbdebugshowtrace=true to get more detailed error info
I think the problem may be that the connectionstring is placed in the webconfig of my .net project from which I moved the usercontrol and dll file to the umbraco root and therefore cannot be found.
Here is a more detailed error:
Error creating usercontrol (usercontrols/ProductSearch.ascx) The connection name 'umbracodbConnectionString' was not found in the applications configuration or the connection string is empty. at System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) at ASP.usercontrols_productsearch_ascx.__BuildControlTree(usercontrols_productsearch_ascx __ctrl) at System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at umbraco.macro.loadUserControl(String fileName, Hashtable attributes, Hashtable pageElements)
So your user control is using its own db connection string? I wouldn't do that if you're using the umbraco database anyway. I'd suggest to use the GlobalSettings.DbDSN to get the connection string.
By the way, you don't need to have another database for your own custom tables, in fact, I wouldn't even use another database for my own custom tables
Error on User Control with bound datasource
I get an error when attempting to add a user control that has a listview bound to a database(the same database that was created for the umbraco installation). It may not be best practice to put my own tables in this database but anyway...
Here is the error when loading the site:
Error creating control (usercontrols/ProductSearch.ascx).
Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!
in what context is this? are you using 3rd party package? if so, what package? what umbraco version? also, try adding ?umbdebugshowtrace=true to get more detailed error info
Looking forward to more info.
Cheers,
/Dirk
I think the problem may be that the connectionstring is placed in the webconfig of my .net project from which I moved the usercontrol and dll file to the umbraco root and therefore cannot be found.
Here is a more detailed error:
Error creating usercontrol (usercontrols/ProductSearch.ascx)
The connection name 'umbracodbConnectionString' was not found in the applications configuration or the connection string is empty.
at System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName)
at ASP.usercontrols_productsearch_ascx.__BuildControlTree(usercontrols_productsearch_ascx __ctrl)
at System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters)
at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
at umbraco.macro.loadUserControl(String fileName, Hashtable attributes, Hashtable pageElements)
Double-post
So your user control is using its own db connection string? I wouldn't do that if you're using the umbraco database anyway. I'd suggest to use the GlobalSettings.DbDSN to get the connection string.
By the way, you don't need to have another database for your own custom tables, in fact, I wouldn't even use another database for my own custom tables
Cheers,
/Dirk
You are spot on!
How does this GlobalSettings.DbDSN work?
Can't seem to find it. Which class library does it belong to?
/Fredrik
GlobalSettings lives in the businesslogic assembly.
Cheers,
/Dirk
It worked, thank you!
/Fredrik
is working on a reply...