Question VB Express 2008 / SQL CE Publish Issue

scottydel

New member
Joined
Dec 1, 2009
Messages
3
Programming Experience
Beginner
Hello,

I've seen some similar threads on here but no resolution. I have an app written with VB Express 2008 which uses SQL Compact Edition 3.5, the DB that comes shipped with VB Express 2008.

When I publish, I can run the app on my machine (development machine).

When I try and install on another machine, it is giving this error:

VB.NET:
object: sql sever compact ADO.NET Data Provider
Method: Void ProcessResults(Int32)
Error: OS Error: The OS storage system (ram, cf, sd or ipsm) is not responding. Retry the operation. 
(E:/Development Projects/Application 1/DB_App1.sdf)"

Note that this path: E:/Development Projects/Application 1/DB_App1.sdf

...is specific to my machine (development machine) but the error is popping up when trying to install on another machine. Obviously the other machine doesn't have the same directory structure as mine.

I would think ClickOnce would be smart enough to use a relative path when accessing the .sdf file. Or I am not smart enough to tell it how :) Sometimes the simplest things are the most difficult!

What am I missing? How can I make my app deployable to any other machine?

I'm aware of the .NET Framework and SQL CE pre-requisites, don't think those are the issues, both are included in the install. The issue seems to be related to the literal path to the .sdf DB file not being found on other target machines.

I know ClickOnce uses a target directory deeply nested underneath Documents and Settings to house all of the application components. I checked and the .sdf file is there. But when my app runs it is still using my local machine path, E:/Development Projects/Application 1/DB_App1.sdf.

Any ideas?

:)

Thanks,

Scott
 
Go to project settings and find the connection string, it's value should be something like "Data Source=|DataDirectory|\test2.sdf". You can also open the dataset in Design view and select the tableadapter, in properties window expand the connection (which should be pointing to same setting) and check/set connection string.

When you added the data source the dialog asked if you wanted to add the database to project and modify the connection string. The result would be that the db file was included for deployment and that the connection string was set to the dynamic path like the above example. You may have done things differently, which could explain your static path.
 
JohnH,

Thank you, you were pointing me in the right direction. Here is what I had to do:

  1. manually change my connection string in code files to contain |DataDirectory| instead of my local path
  2. manually change My Project->Publish->Application Files-> .sdf to Data File (Auto)

That enabled me to deploy the application...most of the time. I am able to deploy the app on machine's other than mine. However, in one case the user received this message:

Downloading <A rel=nofollow>file://MyMachine/Program Files/Application/TestApp.application did not succeed.

The path MyMachine/Program Files/Application/ is local to my machine and doesn't seem like it should be part of the installation process. I checked the TestApp.application file (xml file) and found this node inside the file:

VB.NET:
<deployment install="true" mapFileExtensions="true" co.v1:createDesktopShortcut="true">
    <subscription>
      <update>
        <beforeApplicationStartup />
      </update>
    </subscription>
    <deploymentProvider codebase="file://MyMachine/Program%20Files/Application/TestApp.application" />
</deployment>

It seems strange that this codebase attirbute has a local path to my machine.

Any ideas where this is coming from? Little Microsoft elves living in my machine? :confused:

I noticed when I use the publish wizard I have to state where the users will install the app from, and this is where I enter the path above. The only other choices are from a website, or from a CD-ROM/DVD-ROM, which I'm not using either of. So after publishing I head to this directory, grab the files, put them in a .zipped up folder, and distribute this folder to users. This seems to be where I'm going wrong, though it was worked on all but one installation machine.

What to do if I'm not ready to distribute the files on a network, website or CD-ROM, but just want to make the files available for use at a later time (maybe by email distribution, or eventually CD-ROM)?

Any thoughts will be appreciated.

Thanks,

Scott
 
Cd-rom is the "anywhere" option. Leave the Install folder url blank if you don't need to set a specific update location (for automatic updates from static url). Publish Page, Project Designer
 
Back
Top