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?