Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8188409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:54:08+00:00 2026-06-07T02:54:08+00:00

I have a personal website written in ASP.NET Web Pages, with a small SQL

  • 0

I have a personal website written in ASP.NET Web Pages, with a small SQL Server Compact Edition database. This is handy for me because the database is stored as a file (.sdf), and when I add, modify or delete any records and test it out locally, I can just use Publish… in WebMatrix and copy the .sdf file over.

This works great except for a random error message I get when it accesses the .sdf file.

I get…
There is a file sharing violation. A different process might be using the file.

Sometimes a page refresh will fix it, sometimes I have to refresh the page a couple of times. I suppose migrating the database to a SQL Server database will fix it, but I don’t really want to do that. Is that the best option though?

Here’s a link to the site, maybe you’ll hit the error: http://www.garethlewisweb.com

Is there something I have to change in the code, or will I need to ask my hosting company to change something. I don’t really have a lot of experience in this area.

Thanks!

Update

Here’s my code

_AppStart.cshtml

@{
     WebSecurity.InitializeDatabaseConnection("GarethLewisWeb", "UserProfile", "UserId", "Email", true);
     // WebMail.SmtpServer = "mailserver.example.com";
     // WebMail.EnableSsl = true;
     // WebMail.UserName = "username@example.com";
     // WebMail.Password = "your-password";
     // WebMail.From = "your-name-here@example.com";
}

Default.cshtml

@{  
    Layout = "~/Shared/_SiteLayout.cshtml";
    Page.Title = "Home";

    var db = Database.Open("GarethLewisWeb");

    var featuredPhotoSQL = "    SELECT  col " +
                           "      FROM  tablename ";

    var featuredPhoto = db.QuerySingle(featuredPhotoSQL);
}


[Lots of HTML and C# code here...]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:54:10+00:00Added an answer on June 7, 2026 at 2:54 am

    Not really an answer to this specific problem, but the migration to SQL Server solved this issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an ASP.NET web page with C# behind that runs an existing
I have written an ASP.NET page for a customer which uses the C# Facebook
I have an personal profile website at http://www.kaidul.web44.net/ and I have used jquery, flash
I'm building a small-scale website (a personal one) in which each page would have
I have my personal website at www.yassershaikh.com, now I am planning to setup a
I have a personal project I'm planning and I came to a small hurdle.
I have a database for my personal site and at the moment it is
I have my personal website that I am developing so I can showcase my
i have a website (personal site) where i upload my music. i am a
I have to build a simple personal website for someone. The only problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.