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 6805749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:37:27+00:00 2026-05-26T19:37:27+00:00

I have a simple winforms application. I use SQL Compact DB with Linq. I

  • 0

I have a simple winforms application.
I use SQL Compact DB with Linq.
I had an image column which holds a client image.

I wanted to change the column type to string so it will hold the image path.
I’ve changed the column type to nvarchar(500) and the model accordingly.

If I don’t set the image column, I can save the object to the DB with no problem (by using the generated method “SaveChanges”).

When setting the image field and trying to save on my machine (win.7 Home Premium) everything is working great,
When setting the image field and trying to save on the client machine (win. XP professional) I get the following error:

System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlServerCe.SqlCeException: The path is not valid. Check the directory for the database. [ Path = ..\DB\OpticControlMainDB.sdf ]
   at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
   at System.Data.SqlServerCe.SqlCeConnection.Open()
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, 

DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
   --- End of inner exception stack trace ---
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
   at System.Data.EntityClient.EntityConnection.Open()
   at System.Data.Objects.ObjectContext.EnsureConnection()
   at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
   at System.Data.Objects.ObjectContext.SaveChanges()
   at OpticControl.CustomerDetailsModel.SaveChanges() in <MY_PATH>\CustomerDetailsModel.cs:line 502
   at OpticControl.CustomerDetailsPresenter.SaveCustomerPersonalDetails(Object sender, EventArgs args) in <MY_PATH>\CustomerDetailsPresenter.cs:line 149

I’ve tried to create a new column (“imagePath”) and delete the old column – the problem is still exist.

Any idea?

  • 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-05-26T19:37:28+00:00Added an answer on May 26, 2026 at 7:37 pm

    Seems like I’ve figured out what is going on (it could be useful to other people that will meet this problem):

    I’ve used Process Monitor (from Sysinternals) to find out what is the path that the application is trying to access and find out the it is wrong.

    My connection string is pointing to a path with the structure: ..\DB\.

    When getting the image path from the user I am using a FileDialog. Seems like on XP (not on win.7) this chages the appliction context and when using the connection string it starts to navigate from the dialog last folder (is the selected picture is located at c:\pics\pic.jpg, the the app will access the DB in the path c:\).

    I’ve validate that this was the issue by using an absolute path (instead of relative).

    oh…

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

Sidebar

Related Questions

i have a very simple winforms application. i do not use the forms object
I have simple WinForms application where modifying Windows Registry. The problem is that in
I have made a simple test application for the issue, two winforms each containing
If I wanted to have my data in SQL Server, but wanted to use
I have a C# WinForms application with a database backend (oracle) and use NHibernate
I am working on a winforms application using LINQ to SQL - and am
For simple 'internal use only' apps, Winforms has a useful default exception handler, which
I have a simple C# Winforms application. It isn't multi-threaded (yet). When I debug
I have a simple winforms application in VB.NET 2008. I am using a form
I have a simple WinForms type application (main form, couple of sub-forms, minimize to

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.