Copied to clipboard

Flag this post as spam?

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


  • Ram Prahalad 11 posts 101 karma points
    Jul 13, 2022 @ 14:10
    Ram Prahalad
    0

    .SDF File is missing but the connection string points to that but yet, the website is working.

    I just cloned down our company website version 7.10.6 and I looked at the App_Data folder. There is a .mdf and the .log file. But there is no physical .sdf file.

    The connection string though in the web.config is this and is pointing to the .sdf file:

    <add name="umbracoDbDSN" connectionString="Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0" />
    

    The website seems to be working just great though.

    Can you please explain how its working when there is no physical .sdf file? How is the .mdf file being inferred to as a .sdf file? I am new to Sql Server CE and so, any help would be greatly appreciated!

    Thanks!

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Jul 13, 2022 @ 15:50
    Nik
    100

    Hi Ram,

    When you say you cloned down the website, was it an UmbracoCloud website? Or a normal Umbraco website?

    There was something I've seen, although I never had a chance to investigate it fully, where instead of using SQLCE it would switch to using LocalDB and you'd get an MDF and Log file instead even with a CE connection string, so it could be that potentially.

    LocalDB only triggered if you had SQL Server 2016 and newer running locally I think.

    Nik

  • Ram Prahalad 11 posts 101 karma points
    Jul 13, 2022 @ 15:53
    Ram Prahalad
    0

    Hi @Nik,

    It is an Umbraco Cloud website. You are right. I don't have SQL server CE installed but I do have SQL Server localdb installed.

    But what I am unsure of is how the web.config connection string still points to an non-existent sdf file but the website still works fine. This is making me wonder how it is actually working.

    Yeah, you nailed it. That's exactly my doubt as well. Somehow it is reading the mdf file.

    Thanks for your response.

  • Nik 1617 posts 7263 karma points MVP 7x c-trib
    Jul 13, 2022 @ 16:11
    Nik
    0

    I think you'd need to examine some of the core CMS Dll's to get your answer there. I'm fairly sure at start up it does some checks to see what SQL is available and that is where the code makes it's decision.

    That is how it is working :-) Some clever magic :-D

  • Ram Prahalad 11 posts 101 karma points
    Jul 13, 2022 @ 16:28
    Ram Prahalad
    0

    Ha Ha. I am almost like, If it works, it works. But it is a bit nervy.

Please Sign in or register to post replies

Write your reply to:

Draft