Copied to clipboard

Flag this post as spam?

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


  • Fredrik 89 posts 108 karma points
    Oct 05, 2010 @ 16:30
    Fredrik
    0

    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!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 05, 2010 @ 17:17
    Dirk De Grave
    0

    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

     

  • Fredrik 89 posts 108 karma points
    Oct 06, 2010 @ 08:54
    Fredrik
    0

    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)

  • Fredrik 89 posts 108 karma points
    Oct 06, 2010 @ 08:54
    Fredrik
    0

    Double-post

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 06, 2010 @ 09:01
    Dirk De Grave
    0

    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

  • Fredrik 89 posts 108 karma points
    Oct 06, 2010 @ 09:30
    Fredrik
    0

    You are spot on!

    How does this GlobalSettings.DbDSN work?

    Can't seem to find it. Which class library does it belong to?

    /Fredrik

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 06, 2010 @ 09:58
    Dirk De Grave
    0

    GlobalSettings lives in the businesslogic assembly.

     

    Cheers,

    /Dirk

  • Fredrik 89 posts 108 karma points
    Oct 06, 2010 @ 10:02
    Fredrik
    0

    It worked, thank you!

    /Fredrik

Please Sign in or register to post replies

Write your reply to:

Draft