Copied to clipboard

Flag this post as spam?

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


  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Oct 03, 2018 @ 14:01
    Bo Damgaard Mortensen
    0

    Umbraco Forms tables missing in umbraco.mdf

    Hi all,

    I recently created a new site in Umbraco Cloud where I started the solution on a starter subscription and later upgraded to Pro version.

    I just went with using the filebased umbraco.mdf database for local development purposes and now I wanted to create a few custom tables, one of which would make sense to relate to the UFRecord table.

    However, when I attach the database file (Umbraco.mdf) in MSSQL Management Studio and expand the Tables, the Umbraco Forms tables are not there, even though the section in Umbraco runs just as it should: I can create forms, workflows etc :-)

    I've tried to remove the "install" file which lives in App_Plugins/UmbracoForms/ hoping that it would've (re)publish the tables when the app pool was refreshed, but they don't seem to get published.

    Am I missing something completely obvious here?

    Thanks a lot in advance :-)

    Screenshot of the umbraco.mdf database for convenience:

    enter image description here

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Oct 03, 2018 @ 14:10
    Nik
    0

    Hi Bo,

    I suspect, looking at your SQL Server version, that the mdf file isn't being used by your local copy. I suspect it is actually using LocalDb instead. The Cloud project checks if LocalDb is available and if it does it uses that instead of SQLCE.

    If you want to check this, put this put a breakpoint in your master layout file and perform a Watch on

    ApplicationContext.DatabaseContext.ConnectionString
    

    This should, I suspect, point you to LocalDb instead of a SQL CE connection.

    Nik

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Oct 03, 2018 @ 14:40
    Bo Damgaard Mortensen
    0

    Thanks for your reply, Nik :-) Greatly appreciated.

    You may be right. I'm not very familiar with file-based dbs, I must admit. The connection string looks like this:

    Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;
    

    Isn't that supposed to use the umbraco.mdf file, or? :-)

    Thanks again!

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Oct 03, 2018 @ 14:55
    Nik
    1

    Hi Bo,

    Nope, that looks like it should be creating a SDF file in App_Data not an MDF file.

    • MDF is indicative of Full SQL,
    • SDF is indicative of SQLCE (Compact Edition)

    To access an SDF file, you will probably want to use this extension for Visual Studio https://marketplace.visualstudio.com/items?itemName=ErikEJ.SQLServerCompactSQLiteToolbox

    There is still a possibility that LocalDB is being used as well, but check if you have an SDF file first.

    Nik

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Oct 03, 2018 @ 18:34
    Bo Damgaard Mortensen
    1

    Hi Nik,

    Sure enough, the tables resided in the SDF file rather than the MDF file. Learned something new today ;-)

    Installed the VS extension from your link and migrated SDF db to a local, regular SQL database instead. I'm probably just a grumpy, ol' man, but somehow I prefer a "real" database rather than a file.

    Anyhow, everything works just as it should now. Thanks a lot for your help :-)

Please Sign in or register to post replies

Write your reply to:

Draft